Skip to main content

Module metrics

Module metrics 

Source
Expand description

Metrics collection and performance instrumentation.

Provides counters, gauges, histograms, rolling rates, exponential moving averages, a Prometheus-compatible text exporter, and a performance dashboard that aggregates engine-level statistics into a formatted table.

Structs§

AggregateStats
Compute summary statistics over a slice of f64 values.
CategoryReport
Detailed per-category memory statistics.
EngineSnapshot
A snapshot of engine-level performance data passed to PerformanceDashboard.
ExponentialMovingAverage
Exponential moving average with configurable smoothing factor α.
HistogramBuckets
Configurable histogram bucket boundaries with statistical helpers.
MemoryTracker
Tracks per-category memory allocations with explicit alloc/free calls.
Metric
A single named metric with labels and a current value.
MetricsExporter
Formats a snapshot of metrics as Prometheus text exposition format.
MetricsRegistry
Thread-safe registry for creating and updating metrics.
PerformanceDashboard
Aggregates engine performance metrics and renders them as a formatted table with box-drawing characters.
RollingCounter
A counter that tracks events in a fixed time window using a ring buffer.
TimeSeries
A simple fixed-capacity ring buffer of (timestamp_ms, f64) samples.

Enums§

MetricKind
The kind of a metric, determining how its value is interpreted.
MetricValue
The actual numeric value stored by a Metric.