@@ -186,7 +186,7 @@ def get_memory_sample(self, duration: timedelta | None = None) -> list[Snapshot]
186
186
Returns:
187
187
A sample of memory snapshots.
188
188
"""
189
- snapshots = cast (list [Snapshot ], self ._memory_snapshots )
189
+ snapshots = cast (' list[Snapshot]' , self ._memory_snapshots )
190
190
return self ._get_sample (snapshots , duration )
191
191
192
192
@ensure_context
@@ -199,7 +199,7 @@ def get_event_loop_sample(self, duration: timedelta | None = None) -> list[Snaps
199
199
Returns:
200
200
A sample of event loop snapshots.
201
201
"""
202
- snapshots = cast (list [Snapshot ], self ._event_loop_snapshots )
202
+ snapshots = cast (' list[Snapshot]' , self ._event_loop_snapshots )
203
203
return self ._get_sample (snapshots , duration )
204
204
205
205
@ensure_context
@@ -212,7 +212,7 @@ def get_cpu_sample(self, duration: timedelta | None = None) -> list[Snapshot]:
212
212
Returns:
213
213
A sample of CPU snapshots.
214
214
"""
215
- snapshots = cast (list [Snapshot ], self ._cpu_snapshots )
215
+ snapshots = cast (' list[Snapshot]' , self ._cpu_snapshots )
216
216
return self ._get_sample (snapshots , duration )
217
217
218
218
@ensure_context
@@ -225,7 +225,7 @@ def get_client_sample(self, duration: timedelta | None = None) -> list[Snapshot]
225
225
Returns:
226
226
A sample of client snapshots.
227
227
"""
228
- snapshots = cast (list [Snapshot ], self ._client_snapshots )
228
+ snapshots = cast (' list[Snapshot]' , self ._client_snapshots )
229
229
return self ._get_sample (snapshots , duration )
230
230
231
231
@staticmethod
@@ -255,7 +255,7 @@ def _snapshot_cpu(self, event_data: EventSystemInfoData) -> None:
255
255
created_at = event_data .cpu_info .created_at ,
256
256
)
257
257
258
- snapshots = cast (list [Snapshot ], self ._cpu_snapshots )
258
+ snapshots = cast (' list[Snapshot]' , self ._cpu_snapshots )
259
259
self ._prune_snapshots (snapshots , event_data .cpu_info .created_at )
260
260
self ._cpu_snapshots .add (snapshot )
261
261
@@ -275,7 +275,7 @@ def _snapshot_memory(self, event_data: EventSystemInfoData) -> None:
275
275
created_at = event_data .memory_info .created_at ,
276
276
)
277
277
278
- snapshots = cast (list [Snapshot ], self ._memory_snapshots )
278
+ snapshots = cast (' list[Snapshot]' , self ._memory_snapshots )
279
279
self ._prune_snapshots (snapshots , snapshot .created_at )
280
280
self ._memory_snapshots .add (snapshot )
281
281
self ._evaluate_memory_load (event_data .memory_info .current_size , event_data .memory_info .created_at )
@@ -295,7 +295,7 @@ def _snapshot_event_loop(self) -> None:
295
295
event_loop_delay = snapshot .created_at - previous_snapshot .created_at - self ._EVENT_LOOP_SNAPSHOT_INTERVAL
296
296
snapshot .delay = event_loop_delay
297
297
298
- snapshots = cast (list [Snapshot ], self ._event_loop_snapshots )
298
+ snapshots = cast (' list[Snapshot]' , self ._event_loop_snapshots )
299
299
self ._prune_snapshots (snapshots , snapshot .created_at )
300
300
self ._event_loop_snapshots .add (snapshot )
301
301
@@ -312,7 +312,7 @@ def _snapshot_client(self) -> None:
312
312
error_count = rate_limit_errors .get (self ._CLIENT_RATE_LIMIT_ERROR_RETRY_COUNT , 0 )
313
313
snapshot = ClientSnapshot (error_count = error_count , max_error_count = self ._max_client_errors )
314
314
315
- snapshots = cast (list [Snapshot ], self ._client_snapshots )
315
+ snapshots = cast (' list[Snapshot]' , self ._client_snapshots )
316
316
self ._prune_snapshots (snapshots , snapshot .created_at )
317
317
self ._client_snapshots .add (snapshot )
318
318
0 commit comments