MCPcopy Index your code
hub / github.com/python/cpython / collect

Method collect

Lib/profiling/sampling/collector.py:67–77  ·  view source on GitHub ↗

Collect profiling data from stack frames. Args: stack_frames: List of InterpreterInfo objects timestamps_us: Optional list of timestamps in microseconds. If provided (from binary replay with RLE batching), use these instead of current

(self, stack_frames, timestamps_us=None)

Source from the content-addressed store, hash-verified

65class Collector(ABC):
66 @abstractmethod
67 def collect(self, stack_frames, timestamps_us=None):
68 """Collect profiling data from stack frames.
69
70 Args:
71 stack_frames: List of InterpreterInfo objects
72 timestamps_us: Optional list of timestamps in microseconds. If provided
73 (from binary replay with RLE batching), use these instead of current
74 time. If None, collectors should use time.monotonic() or similar.
75 The list may contain multiple timestamps when samples are batched
76 together (same stack, different times).
77 """
78
79 def collect_failed_sample(self):
80 """Collect data about a failed sample attempt."""

Callers 3

sampleMethod · 0.45
benchmark_memoryMethod · 0.45
measure_peak_memoryMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected