pub struct Recorder<C: Counter> { /* private fields */ }
Expand description

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

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.

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.

Trait Implementations

Performs the += operation. Read more
Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.