Struct kumo_prometheus::parser::HistogramMetric
source · pub struct HistogramMetric {
pub name: InternString,
pub labels: Map<InternString, InternString>,
pub sum: f64,
pub count: f64,
pub bucket: Vec<(f64, f64)>,
}
Fields§
§name: InternString
§labels: Map<InternString, InternString>
§sum: f64
§count: f64
§bucket: Vec<(f64, f64)>
Implementations§
source§impl HistogramMetric
impl HistogramMetric
sourcepub fn quantile(&self, q: f64) -> f64
pub fn quantile(&self, q: f64) -> f64
Given a quantile (eg: p90 would be q=0.9), returns the approximate observed latency value that that percentage of samples would have recorded. The value is approximated through linear interpolation across the range found in the last matching bucket.
This logic is derived from the histogramQuantile function in prometheus https://github.com/prometheus/prometheus/blob/1435c8ae4aa1041592778018ba62fc3058a9ad3d/promql/quantile.go#L177
Trait Implementations§
source§impl Debug for HistogramMetric
impl Debug for HistogramMetric
source§impl PartialEq for HistogramMetric
impl PartialEq for HistogramMetric
impl StructuralPartialEq for HistogramMetric
Auto Trait Implementations§
impl Freeze for HistogramMetric
impl RefUnwindSafe for HistogramMetric
impl Send for HistogramMetric
impl Sync for HistogramMetric
impl Unpin for HistogramMetric
impl UnwindSafe for HistogramMetric
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