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