Skip to main content

LimitTracker

Struct LimitTracker 

Source
pub struct LimitTracker { /* private fields */ }
Expand description

Per-limit history (module docs). One per engine; pure.

Implementations§

Source§

impl LimitTracker

Source

pub fn new() -> Self

Source

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.

Source

pub fn gc(&mut self, now_ms: u64)

Forgets limits not seen for RETENTION_MS.

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn points(&self, id: &str) -> Vec<(u64, u64)>

Points of id (oldest first), for tests and sparklines.

Source

pub fn kills(&self, id: &str) -> (u64, Option<u64>)

OOM kills observed while watching and when the newest was noticed.

Source

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).

Source

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.

Trait Implementations§

Source§

impl Clone for LimitTracker

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for LimitTracker

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for LimitTracker

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Forget for LimitTracker

§

impl Freeze for LimitTracker
where *const LeafNode<String, Series> is !null: Freeze, PhantomData<(Owned, LeafOrInternal)>: Freeze, PhantomData<Box<(String, Series)>>: Freeze,

§

impl Move for LimitTracker

§

impl RefUnwindSafe for LimitTracker

§

impl Send for LimitTracker
where NodeRef<Owned, String, Series, LeafOrInternal>: Send, BoxRaw<(String, Series)>: Send,

§

impl Sync for LimitTracker
where NodeRef<Owned, String, Series, LeafOrInternal>: Sync, BoxRaw<(String, Series)>: Sync,

§

impl Unpin for LimitTracker
where *const LeafNode<String, Series> is !null: Unpin, Box<(String, Series)>: Unpin,

§

impl UnsafeUnpin for LimitTracker
where *const LeafNode<String, Series> is !null: UnsafeUnpin, PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin, PhantomData<Box<(String, Series)>>: UnsafeUnpin,

§

impl UnwindSafe for LimitTracker
where BTreeMap<String, Series>: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.