pub struct Window { /* private fields */ }Expand description
a histogram over the last slots spans of time
Implementations§
Source§impl Window
impl Window
Sourcepub fn new(slots: usize, span: u64) -> Window
pub fn new(slots: usize, span: u64) -> Window
slots slots of span time units each (at least one of each)
pub fn with_bits(slots: usize, span: u64, bits: u8) -> Window
pub fn slots(&self) -> usize
Sourcepub fn bytes(&self) -> usize
pub fn bytes(&self) -> usize
the heap memory it holds: its slots and their histograms (none before the first value)
pub fn span(&self) -> u64
Sourcepub fn record(&mut self, t: u64, v: u64) -> bool
pub fn record(&mut self, t: u64, v: u64) -> bool
counts v at time t; false when t lies before the window that ends at the newest
time recorded so far
pub fn record_n(&mut self, t: u64, v: u64, n: u32) -> bool
Sourcepub fn hist_between(&self, from: u64, to: u64) -> Hist
pub fn hist_between(&self, from: u64, to: u64) -> Hist
the slots that start in [from, to) as one histogram: what was recorded between two times, to the resolution of the slots; slots the ring no longer holds are left out
pub fn count(&self, t: u64) -> u64
pub fn sum(&self, t: u64) -> u128
pub fn mean(&self, t: u64) -> Option<u64>
pub fn min(&self, t: u64) -> Option<u64>
pub fn max(&self, t: u64) -> Option<u64>
pub fn quantile(&self, t: u64, per_mille: u32) -> Option<u64>
pub fn p50(&self, t: u64) -> Option<u64>
pub fn p95(&self, t: u64) -> Option<u64>
pub fn p99(&self, t: u64) -> Option<u64>
Trait Implementations§
impl Eq for Window
impl StructuralPartialEq for Window
Auto Trait Implementations§
impl Forget for Window
impl Freeze for Window
impl RefUnwindSafe for Window
impl Send for Window
impl Sync for Window
impl Unpin for Window
impl UnsafeUnpin for Window
impl UnwindSafe for Window
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more