pub struct HistogramSnapshot {
pub buckets: Vec<u64>,
pub counts: Vec<u64>,
pub sum: u64,
pub count: u64,
}Expand description
Snapshot of histogram data.
Fields§
§buckets: Vec<u64>Bucket boundaries in microseconds
counts: Vec<u64>Counts per bucket
sum: u64Sum of all observations in microseconds
count: u64Total count
Implementations§
Source§impl HistogramSnapshot
impl HistogramSnapshot
Sourcepub fn to_prometheus(&self, name: &str, help: &str) -> String
pub fn to_prometheus(&self, name: &str, help: &str) -> String
Export to Prometheus format.
Sourcepub fn mean_micros(&self) -> f64
pub fn mean_micros(&self) -> f64
Get the mean value in microseconds.
Sourcepub fn percentile_micros(&self, p: f64) -> u64
pub fn percentile_micros(&self, p: f64) -> u64
Get the approximate percentile value in microseconds.
Trait Implementations§
Source§impl Clone for HistogramSnapshot
impl Clone for HistogramSnapshot
Source§fn clone(&self) -> HistogramSnapshot
fn clone(&self) -> HistogramSnapshot
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 HistogramSnapshot
impl RefUnwindSafe for HistogramSnapshot
impl Send for HistogramSnapshot
impl Sync for HistogramSnapshot
impl Unpin for HistogramSnapshot
impl UnsafeUnpin for HistogramSnapshot
impl UnwindSafe for HistogramSnapshot
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request