Class MetricsService
In-memory metrics store with a circular buffer.
Provides collection of process/system metrics and history queries.
Cross-platform: Windows, Linux, macOS.
public class MetricsService
Inheritance
Properties
Methods
AddPoint(MetricsPoint)
Add a metrics data point to the circular buffer.
public void AddPoint(MetricsPoint point)
CollectCurrentMetrics()
Collect current process and system metrics.
public MetricsPoint CollectCurrentMetrics()
GetHistory(int)
Get historical metric data for the given time window.
public IReadOnlyList<MetricsPoint> GetHistory(int minutes)
GetLatest()
Get the latest (most recent) metrics point, or null if empty.
public MetricsPoint? GetLatest()
GetSnapshot()
Get a full snapshot: latest point + buffer size.
public (MetricsPoint? Latest, int StoredPoints) GetSnapshot()