@@ -102,10 +102,10 @@ def __init__(
102
102
103
103
@classmethod
104
104
def from_config (cls , config : Configuration | None = None ) -> Snapshotter :
105
- """Create a new instance based on the provided configuration .
105
+ """Create a new instance based on the provided `Configuration` .
106
106
107
107
Args:
108
- config: The configuration object . Uses the global (default) configuration if not provided.
108
+ config: The `Configuration` instance . Uses the global (default) one if not provided.
109
109
"""
110
110
config = service_locator .get_configuration ()
111
111
@@ -132,7 +132,7 @@ def _get_sorted_list_by_created_at(input_list: list[T]) -> SortedList[T]:
132
132
133
133
@property
134
134
def active (self ) -> bool :
135
- """Indicates whether the context is active."""
135
+ """Indicate whether the context is active."""
136
136
return self ._active
137
137
138
138
async def __aenter__ (self ) -> Snapshotter :
@@ -178,7 +178,7 @@ async def __aexit__(
178
178
179
179
@ensure_context
180
180
def get_memory_sample (self , duration : timedelta | None = None ) -> list [Snapshot ]:
181
- """Returns a sample of the latest memory snapshots.
181
+ """Return a sample of the latest memory snapshots.
182
182
183
183
Args:
184
184
duration: The duration of the sample from the latest snapshot. If omitted, it returns a full history.
@@ -191,7 +191,7 @@ def get_memory_sample(self, duration: timedelta | None = None) -> list[Snapshot]
191
191
192
192
@ensure_context
193
193
def get_event_loop_sample (self , duration : timedelta | None = None ) -> list [Snapshot ]:
194
- """Returns a sample of the latest event loop snapshots.
194
+ """Return a sample of the latest event loop snapshots.
195
195
196
196
Args:
197
197
duration: The duration of the sample from the latest snapshot. If omitted, it returns a full history.
@@ -204,7 +204,7 @@ def get_event_loop_sample(self, duration: timedelta | None = None) -> list[Snaps
204
204
205
205
@ensure_context
206
206
def get_cpu_sample (self , duration : timedelta | None = None ) -> list [Snapshot ]:
207
- """Returns a sample of the latest CPU snapshots.
207
+ """Return a sample of the latest CPU snapshots.
208
208
209
209
Args:
210
210
duration: The duration of the sample from the latest snapshot. If omitted, it returns a full history.
@@ -217,7 +217,7 @@ def get_cpu_sample(self, duration: timedelta | None = None) -> list[Snapshot]:
217
217
218
218
@ensure_context
219
219
def get_client_sample (self , duration : timedelta | None = None ) -> list [Snapshot ]:
220
- """Returns a sample of the latest client snapshots.
220
+ """Return a sample of the latest client snapshots.
221
221
222
222
Args:
223
223
duration: The duration of the sample from the latest snapshot. If omitted, it returns a full history.
@@ -230,7 +230,7 @@ def get_client_sample(self, duration: timedelta | None = None) -> list[Snapshot]
230
230
231
231
@staticmethod
232
232
def _get_sample (snapshots : list [Snapshot ], duration : timedelta | None = None ) -> list [Snapshot ]:
233
- """Returns a time-limited sample from snapshots or full history if duration is None."""
233
+ """Return a time-limited sample from snapshots or full history if duration is None."""
234
234
if not duration :
235
235
return snapshots
236
236
0 commit comments