Enum Distribution
pub enum Distribution {
Histogram(Histogram),
Summary(RollingSummary, Arc<Vec<Quantile>>, f64),
}
Expand description
Distribution type.
Variants§
Histogram(Histogram)
A Prometheus histogram.
Exposes “bucketed” values to Prometheus, counting the number of samples below a given threshold i.e. 100 requests faster than 20ms, 1000 requests faster than 50ms, etc.
Summary(RollingSummary, Arc<Vec<Quantile>>, f64)
A Prometheus summary.
Computes and exposes value quantiles directly to Prometheus i.e. 50% of requests were faster than 200ms, and 99% of requests were faster than 1000ms, etc.
Implementations§
§impl Distribution
impl Distribution
pub fn new_histogram(buckets: &[f64]) -> Distribution
pub fn new_histogram(buckets: &[f64]) -> Distribution
pub fn new_summary(
quantiles: Arc<Vec<Quantile>>,
bucket_duration: Duration,
bucket_count: NonZero<u32>,
) -> Distribution
pub fn new_summary( quantiles: Arc<Vec<Quantile>>, bucket_duration: Duration, bucket_count: NonZero<u32>, ) -> Distribution
Creates a summary distribution.
pub fn record_samples(&mut self, samples: &[(f64, Instant)])
pub fn record_samples(&mut self, samples: &[(f64, Instant)])
Records the given samples
in the current distribution.
Trait Implementations§
§impl Clone for Distribution
impl Clone for Distribution
§fn clone(&self) -> Distribution
fn clone(&self) -> Distribution
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for Distribution
impl RefUnwindSafe for Distribution
impl Send for Distribution
impl Sync for Distribution
impl Unpin for Distribution
impl UnwindSafe for Distribution
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<T> MaybeSend for Twhere
T: Send,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 88 bytes
Size for each variant:
Histogram
: 72 bytesSummary
: 88 bytes