pub struct NativeHistogramConfig { /* private fields */ }Expand description
Configuration for native histograms.
Implementations§
Source§impl NativeHistogramConfig
impl NativeHistogramConfig
Sourcepub fn new(
bucket_factor: f64,
max_buckets: u32,
zero_threshold: f64,
) -> Result<Self, &'static str>
pub fn new( bucket_factor: f64, max_buckets: u32, zero_threshold: f64, ) -> Result<Self, &'static str>
Creates a new native histogram configuration.
§Arguments
bucket_factor- The base for exponential buckets (must be > 1.0)max_buckets- Maximum number of buckets to limit memory usagezero_threshold- Threshold for considering values as zero (must be >= 0.0)
§Returns
A new configuration, or an error if parameters are invalid.
§Errors
Returns an error if bucket_factor is not greater than 1.0, max_buckets is 0,
or zero_threshold is negative.
Sourcepub fn bucket_factor(&self) -> f64
pub fn bucket_factor(&self) -> f64
Returns the bucket factor.
Sourcepub fn max_buckets(&self) -> u32
pub fn max_buckets(&self) -> u32
Returns the maximum number of buckets.
Sourcepub fn zero_threshold(&self) -> f64
pub fn zero_threshold(&self) -> f64
Returns the zero threshold.
Trait Implementations§
Source§impl Clone for NativeHistogramConfig
impl Clone for NativeHistogramConfig
Source§fn clone(&self) -> NativeHistogramConfig
fn clone(&self) -> NativeHistogramConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NativeHistogramConfig
impl RefUnwindSafe for NativeHistogramConfig
impl Send for NativeHistogramConfig
impl Sync for NativeHistogramConfig
impl Unpin for NativeHistogramConfig
impl UnwindSafe for NativeHistogramConfig
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