Enum goodmetrics::Distribution
source · pub enum Distribution {
I64(i64),
I32(i32),
U64(u64),
U32(u32),
Collection(Vec<i64>),
Timer {
nanos: Arc<AtomicUsize>,
},
}
Expand description
Values able to be collected into a distribution
Variants§
I64(i64)
an integer distribution value
I32(i32)
an integer distribution value
U64(u64)
an unsigned integer distribution value
U32(u32)
an unsigned integer distribution value
Collection(Vec<i64>)
Encapsulates observations of a raw value. Bucketing and aggregation happens in the pipeline. From<&u8> is not defined because it costs a copy. Also, this unconditionally uses the global allocator. PR to plumb the allocator type out would be welcome.
Timer
A helper for recording a distribution of time. This is shared by a Timer with a Drop implementation and the Metrics object for it. I don’t enforce that the timer is dropped before the metrics, because tokio::spawn requires that the closure is owned for ’static. So extremely rigorous correctness takes a backseat to usability here.
Fields
nanos: Arc<AtomicUsize>
The number of nanoseconds this value represents.
Trait Implementations§
source§impl Debug for Distribution
impl Debug for Distribution
source§impl From<Distribution> for Value
impl From<Distribution> for Value
source§fn from(value: Distribution) -> Self
fn from(value: Distribution) -> Self
source§impl From<Duration> for Distribution
impl From<Duration> for Distribution
source§impl From<i32> for Distribution
impl From<i32> for Distribution
source§impl From<i64> for Distribution
impl From<i64> for Distribution
source§impl From<u32> for Distribution
impl From<u32> for Distribution
Auto 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> 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>
T
in a tonic::Request