[−][src]Struct hdrhistogram::sync::Recorder
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
.
Methods
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]
&mut self,
source: B
) -> Result<(), AdditionError>
See Histogram::add
.
pub fn add_correct<B: Borrow<Histogram<C>>>(
&mut self,
source: B,
interval: u64
) -> Result<(), RecordError>
[src]
&mut self,
source: B,
interval: u64
) -> Result<(), RecordError>
pub fn subtract<B: Borrow<Histogram<C>>>(
&mut self,
subtrahend: B
) -> Result<(), SubtractionError>
[src]
&mut self,
subtrahend: B
) -> Result<(), SubtractionError>
See Histogram::subtract
.
pub fn record(&mut self, value: u64) -> Result<(), RecordError>
[src]
See Histogram::record
.
pub fn saturating_record(&mut self, value: u64)
[src]
pub fn record_n(&mut self, value: u64, count: C) -> Result<(), RecordError>
[src]
See Histogram::record_n
.
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]
&mut self,
value: u64,
interval: u64
) -> Result<(), RecordError>
pub fn record_n_correct(
&mut self,
value: u64,
count: C,
interval: u64
) -> Result<(), RecordError>
[src]
&mut self,
value: u64,
count: C,
interval: u64
) -> Result<(), RecordError>
Trait Implementations
impl<C: Counter> Drop for Recorder<C>
[src]
impl<C: Counter> Clone for Recorder<C>
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<C: Counter> AddAssign<u64> for Recorder<C>
[src]
fn add_assign(&mut self, value: u64)
[src]
impl<C: Debug + Counter> Debug for Recorder<C>
[src]
Auto Trait Implementations
impl<C> Send for Recorder<C> where
C: Send,
C: Send,
impl<C> Unpin for Recorder<C> where
C: Unpin,
C: Unpin,
impl<C> Sync for Recorder<C> where
C: Send + Sync,
C: Send + Sync,
impl<C> UnwindSafe for Recorder<C> where
C: UnwindSafe,
C: UnwindSafe,
impl<C> RefUnwindSafe for Recorder<C> where
C: RefUnwindSafe,
C: RefUnwindSafe,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,