pub struct MetricsSnapshot {
pub per_motif_count: [u64; 5],
pub per_motif_last_peak: [f64; 5],
pub per_motif_last_trust_sum: [f64; 5],
pub streaming_staged: u64,
pub streaming_flushed: u64,
pub streaming_dropped_out_of_window: u64,
}Expand description
Snapshot of counters an exporter can publish directly. Constructed
from an Episode slice (typically the output of one
MotifEngine::run or the accumulated set of closed episodes in a
long-running daemon).
Fields§
§per_motif_count: [u64; 5]Per-motif total episode count.
per_motif_last_peak: [f64; 5]Per-motif last-episode peak |residual| (NaN when none).
per_motif_last_trust_sum: [f64; 5]Per-motif last-episode trust sum (NaN when none).
streaming_staged: u64Residuals currently held in a streaming ingestor’s buffer.
streaming_flushed: u64Residuals the streaming ingestor has flushed to its stream.
streaming_dropped_out_of_window: u64Residuals the streaming ingestor dropped because they fell outside the reorder window.
Implementations§
Source§impl MetricsSnapshot
impl MetricsSnapshot
Sourcepub fn from_episodes(episodes: &[Episode]) -> Self
pub fn from_episodes(episodes: &[Episode]) -> Self
Build a snapshot from an Episode slice. Order matters only
in that the last episode per motif (by insertion order)
determines last_peak and last_trust_sum.
Sourcepub fn with_streaming(self, ing: &StreamingIngestor) -> Self
pub fn with_streaming(self, ing: &StreamingIngestor) -> Self
Fold the streaming ingestor’s counters into an existing snapshot. The ingestor is borrowed immutably — callers can continue to push samples into it after this call.
Trait Implementations§
Source§impl Clone for MetricsSnapshot
impl Clone for MetricsSnapshot
Source§fn clone(&self) -> MetricsSnapshot
fn clone(&self) -> MetricsSnapshot
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more