trinity.perf.resource_sampler module#
Threaded resource sampler for performance tooling.
- class trinity.perf.resource_sampler.ResourceSampler(interval_seconds: float, backend: SystemResourceBackend | None = None)[source]#
Bases:
objectPeriodically collect system resource samples in a background thread.
- __init__(interval_seconds: float, backend: SystemResourceBackend | None = None) None[source]#
- stop() list[ResourceSample][source]#
Stop sampling and return the collected samples.
- samples() list[ResourceSample][source]#
Return a snapshot of all collected samples.