pub struct LimitTracker { /* private fields */ }Expand description
Per-limit history (module docs). One per engine; pure.
Implementations§
Source§impl LimitTracker
impl LimitTracker
pub fn new() -> Self
Sourcepub fn observe(
&mut self,
id: &str,
at_ms: u64,
usage: Option<u64>,
events: Option<MemoryEvents>,
)
pub fn observe( &mut self, id: &str, at_ms: u64, usage: Option<u64>, events: Option<MemoryEvents>, )
Records one reading. A reading not newer than the newest point of id (a cached value repeated by a
later snapshot) is ignored; counters are compared with the previous reading.
Sourcepub fn gc(&mut self, now_ms: u64)
pub fn gc(&mut self, now_ms: u64)
Forgets limits not seen for RETENTION_MS.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn points(&self, id: &str) -> Vec<(u64, u64)>
pub fn points(&self, id: &str) -> Vec<(u64, u64)>
Points of id (oldest first), for tests and sparklines.
Sourcepub fn kills(&self, id: &str) -> (u64, Option<u64>)
pub fn kills(&self, id: &str) -> (u64, Option<u64>)
OOM kills observed while watching and when the newest was noticed.
Sourcepub fn growth_per_min(&self, id: &str) -> Measured<f64>
pub fn growth_per_min(&self, id: &str) -> Measured<f64>
Growth rate (bytes/min) over the newest ≤ 5 min: an estimate, without the forecast’s consistency guards (for an arrow next to a gauge).
Sourcepub fn forecast(
&self,
id: &str,
limit: u64,
target: LimitTarget,
now_ms: u64,
) -> Option<LimitForecast>
pub fn forecast( &self, id: &str, limit: u64, target: LimitTarget, now_ms: u64, ) -> Option<LimitForecast>
ETA of id to limit bytes, under the host forecast’s rules (module docs). now_ms is the
snapshot time: a series whose newest reading is older than MAX_STALE_S is not forecast, and a
slightly stale one has its ETA measured from now.