pub struct FieldStat<TStatType: 'static> { /* private fields */ }

Implementations§

source§

impl<TStatType> FieldStat<TStatType>

source

pub fn new( tl: &'static LocalKey<FieldStatThreadLocal<TStatType>>, key: String ) -> Self

Trait Implementations§

source§

impl Counter for FieldStat<BoxLocalCounter>

source§

fn increment_value(&self, value: i64)

Increments the counter by the given amount.
source§

impl Histogram for FieldStat<BoxLocalHistogram>

source§

fn add_value(&self, value: i64)

Adds value to the histogram. It is being aggregated based on ExportType
source§

fn add_repeated_value(&self, value: i64, nsamples: u32)

You might want to call this method when you have a very hot counter to avoid some congestions on it. The default implementation simply calls add_value O(nsamples) times. If you have a performance-sensitive use case, check whether your Stats type has an O(1) implementation. Value is the value of a single samples and nsamples is the number of samples. Please notice that difference in the value semantic compared to Timeseries::add_value_aggregated.
source§

fn flush(&self)

Flush any buffered data so that it is observable externally. Should only be used for testing.
source§

impl Timeseries for FieldStat<BoxLocalTimeseries>

source§

fn add_value(&self, value: i64)

Adds value to the timeseries. It is being aggregated based on ExportType
source§

fn add_value_aggregated(&self, value: i64, nsamples: u32)

You might want to call this method when you have a very hot counter to avoid some congestions on it. Value is the sum of values of the samples and nsamples is the number of samples. Please notice that difference in the value semantic compared to Histogram::add_repeated_value.

Auto Trait Implementations§

§

impl<TStatType> RefUnwindSafe for FieldStat<TStatType>

§

impl<TStatType> Send for FieldStat<TStatType>

§

impl<TStatType> Sync for FieldStat<TStatType>

§

impl<TStatType> Unpin for FieldStat<TStatType>

§

impl<TStatType> UnwindSafe for FieldStat<TStatType>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.