dendrite_ring.rs
rust
1pub struct DendriteStore { /* ... */ }
2
3impl DendriteStore {
4 pub fn new(config: DendriteConfig) -> Self;
5 pub fn with_preset(preset: MetricPreset) -> Self;
6
7 // Ingest
8 pub fn ingest(&mut self, timestamp: u64, value: f64) -> Result<Option<&DendriteRing>, DendriteError>;
9 pub fn flush(&mut self) -> Option<&DendriteRing>;
10
11 // Queries
12 pub fn ring_at(&self, timestamp: u64) -> Option<&DendriteRing>;
13 pub fn rings_in_range(&self, start: u64, end: u64) -> &[DendriteRing];
14 pub fn anomalies(&self) -> &[AnomalyEntry];
15 pub fn anomalies_in_range(&self, start: u64, end: u64) -> &[AnomalyEntry];
16 pub fn rings_by_shape(&self, shape: ShapeClass) -> Vec<&DendriteRing>;
17
18 // Maintenance
19 pub fn tick(&mut self) -> usize;
20
21 // Stats
22 pub fn ring_count(&self) -> usize;
23 pub fn memory_usage(&self) -> usize;
24 pub fn storage_profile(&self) -> StorageProfile;
25 pub fn sapwood_rings(&self) -> &[DendriteRing];
26 pub fn heartwood_rings(&self) -> &[DendriteRing];
27 pub fn accumulator_stats(&self) -> Option<AccumulatorStats>;
28}
29