pub struct HistogramConfig { /* private fields */ }Expand description
Implementations§
Source§impl HistogramConfig
impl HistogramConfig
Sourcepub fn new(sig_fig: SigFig, percentiles: Vec<f64>) -> MetricResult<Self>
pub fn new(sig_fig: SigFig, percentiles: Vec<f64>) -> MetricResult<Self>
Creates a new histogram configuration with the given significant figures and percentiles.
§Errors
Returns an error if any percentile is NaN/inf or outside [0.0, 1.0).
Sourcepub fn with_base_metrics(
self,
emit_base_metrics: impl IntoIterator<Item = HistogramBaseMetric>,
) -> Self
pub fn with_base_metrics( self, emit_base_metrics: impl IntoIterator<Item = HistogramBaseMetric>, ) -> Self
Replaces the set of emitted base histogram metrics.
Sourcepub const fn with_count(self, emit: bool) -> Self
pub const fn with_count(self, emit: bool) -> Self
Enables or disables the .count histogram metric.
Sourcepub const fn with_avg(self, emit: bool) -> Self
pub const fn with_avg(self, emit: bool) -> Self
Enables or disables the .avg histogram metric.
Note: .avg currently reflects p50 behavior for compatibility.
Sourcepub fn with_bounds(self, min: u64, max: u64) -> MetricResult<Self>
pub fn with_bounds(self, min: u64, max: u64) -> MetricResult<Self>
Sets histogram recording bounds.
These bounds determine the compatible pool and the histogram allocation shape.
§Errors
Returns an error if min < 1 or max < min.
Trait Implementations§
Source§impl Clone for HistogramConfig
impl Clone for HistogramConfig
Source§fn clone(&self) -> HistogramConfig
fn clone(&self) -> HistogramConfig
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 moreSource§impl Debug for HistogramConfig
impl Debug for HistogramConfig
Auto Trait Implementations§
impl Freeze for HistogramConfig
impl RefUnwindSafe for HistogramConfig
impl Send for HistogramConfig
impl Sync for HistogramConfig
impl Unpin for HistogramConfig
impl UnsafeUnpin for HistogramConfig
impl UnwindSafe for HistogramConfig
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