Struct hdrhistogram::sync::Recorder[][src]

pub struct Recorder<C: Counter> { /* fields omitted */ }

A write-only handle to a SyncHistogram.

This handle allows you to record samples from multiple threads, each with its own Recorder, concurrently. Writes to a Recorder are wait-free and scalable except for when the SyncHistogram initiates a phase shift. During a phase shift, the next write on each associated Recorder merges its results into a shared Histogram that is then made available to the SyncHistogram once the phase shift completes. Phase shifts should also be relatively cheap for writers, as they mainly need to perform a channel send on an unbounded, lock-free channel.

An idle Recorder will hold up a phase shift indefinitely, or until it times out (is using SyncHistogram::refresh_timeout. If a Recorder will remain idle for extended periods of time, it should call Recorder::idle, which will tell the reader not to wait for this particular writer.

When a Recorder is dropped, all samples are made visible to the next SyncHistogram::refresh.

Implementations

impl<C: Counter> Recorder<C>[src]

pub fn idle(&mut self) -> IdleRecorderGuard<'_, C>[src]

Call this method if the Recorder will be idle for a while.

Until the returned guard is dropped, the associated SyncHistogram will not wait for this recorder on a phase shift.

pub fn into_idle(self) -> IdleRecorder<Self, C>[src]

Mark this Recorder as inactive.

Until the returned guard is consumed, either by calling IdleRecorder::activate or by dropping it, the associated SyncHistogram will not wait for this recorder on a phase shift.

pub fn add<B: Borrow<Histogram<C>>>(
    &mut self,
    source: B
) -> Result<(), AdditionError>
[src]

pub fn add_correct<B: Borrow<Histogram<C>>>(
    &mut self,
    source: B,
    interval: u64
) -> Result<(), RecordError>
[src]

pub fn subtract<B: Borrow<Histogram<C>>>(
    &mut self,
    subtrahend: B
) -> Result<(), SubtractionError>
[src]

pub fn record(&mut self, value: u64) -> Result<(), RecordError>[src]

pub fn saturating_record(&mut self, value: u64)[src]

pub fn record_n(&mut self, value: u64, count: C) -> Result<(), RecordError>[src]

pub fn saturating_record_n(&mut self, value: u64, count: C)[src]

pub fn record_correct(
    &mut self,
    value: u64,
    interval: u64
) -> Result<(), RecordError>
[src]

pub fn record_n_correct(
    &mut self,
    value: u64,
    count: C,
    interval: u64
) -> Result<(), RecordError>
[src]

Trait Implementations

impl<C: Counter> AddAssign<u64> for Recorder<C>[src]

impl<C: Counter> Clone for Recorder<C>[src]

impl<C: Debug + Counter> Debug for Recorder<C>[src]

impl<C: Counter> Drop for Recorder<C>[src]

Auto Trait Implementations

impl<C> RefUnwindSafe for Recorder<C> where
    C: RefUnwindSafe

impl<C> Send for Recorder<C> where
    C: Send

impl<C> Sync for Recorder<C> where
    C: Send + Sync

impl<C> Unpin for Recorder<C> where
    C: Unpin

impl<C> UnwindSafe for Recorder<C> where
    C: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryConv for T

impl<T> TryConv for T

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.