pub struct ExponentialDecayHistogram<T = ()> { /* private fields */ }Expand description
A histogram which exponentially weights in favor of recent values.
See the crate level documentation for more details.
Implementations§
Source§impl ExponentialDecayHistogram
impl ExponentialDecayHistogram
Sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Returns a new builder to create a histogram with a custom configuration.
Sourcepub fn with_size_and_alpha(size: usize, alpha: f64) -> Self
👎Deprecated: use ExponentialDecayHistogram::builder() instead
pub fn with_size_and_alpha(size: usize, alpha: f64) -> Self
ExponentialDecayHistogram::builder() insteadReturns 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.
Source§impl<T> ExponentialDecayHistogram<T>where
T: Clone,
impl<T> ExponentialDecayHistogram<T>where
T: Clone,
Sourcepub fn update_ex(&mut self, value: i64, exemplar: T)
pub fn update_ex(&mut self, value: i64, exemplar: T)
Like Self::update, except that it additionally takes an exemplar.
Sourcepub fn update_at_ex(&mut self, time: Instant, value: i64, exemplar: T)
pub fn update_at_ex(&mut self, time: Instant, value: i64, exemplar: T)
Like Self::update_at, except that it additionally takes an exemplar.
Trait Implementations§
Source§impl<T: Debug> Debug for ExponentialDecayHistogram<T>
impl<T: Debug> Debug for ExponentialDecayHistogram<T>
Source§impl Default for ExponentialDecayHistogram
impl Default for ExponentialDecayHistogram
Source§fn default() -> ExponentialDecayHistogram
fn default() -> ExponentialDecayHistogram
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl<T> Freeze for ExponentialDecayHistogram<T>
impl<T> RefUnwindSafe for ExponentialDecayHistogram<T>where
T: RefUnwindSafe,
impl<T> Send for ExponentialDecayHistogram<T>where
T: Send,
impl<T> Sync for ExponentialDecayHistogram<T>where
T: Sync,
impl<T> Unpin for ExponentialDecayHistogram<T>
impl<T> UnwindSafe for ExponentialDecayHistogram<T>where
T: RefUnwindSafe,
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