[−][src]Struct exponential_decay_histogram::ExponentialDecayHistogram
A histogram which exponentially weights in favor of recent values.
See the crate level documentation for more details.
Methods
impl ExponentialDecayHistogram
[src]
pub fn new() -> ExponentialDecayHistogram
[src]
Returns a new histogram with a default configuration.
The default size is 1028, which offers a 99.9% confidence level with a 5% margin of error. The default alpha is 0.015, which heavily biases towards the last 5 minutes of values.
pub fn with_size_and_alpha(size: usize, alpha: f64) -> ExponentialDecayHistogram
[src]
Returns a new histogram configured with the specified size and alpha.
size
specifies the number of values stored in the histogram. A larger
size will provide more accurate statistics, but with a higher memory
overhead.
alpha
specifies the exponential decay factor. A larger factor biases
the histogram towards newer values.
Panics
Panics if size
is zero.
pub fn update(&mut self, value: i64)
[src]
Inserts a value into the histogram at the current time.
pub fn update_at(&mut self, time: Instant, value: i64)
[src]
Inserts a value into the histogram at the specified time.
Panics
May panic if values are inserted at non-monotonically increasing times.
pub fn snapshot(&self) -> Snapshot
[src]
Takes a snapshot of the current state of the histogram.
Trait Implementations
impl Default for ExponentialDecayHistogram
[src]
Auto Trait Implementations
impl Sync for ExponentialDecayHistogram
impl Unpin for ExponentialDecayHistogram
impl Send for ExponentialDecayHistogram
impl UnwindSafe for ExponentialDecayHistogram
impl RefUnwindSafe for ExponentialDecayHistogram
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,