Enum metrics_util::Handle[][src]

pub enum Handle {
    Counter(Arc<AtomicU64>),
    Gauge(Arc<AtomicU64>),
    Histogram(Arc<AtomicBucket<f64>>),
}
Expand description

Basic metric handle.

Provides fast, thread-safe access and storage for the three supported metric types: counters, gauges, and histograms.

Variants

Counter(Arc<AtomicU64>)

A counter.

Gauge(Arc<AtomicU64>)

A gauge.

Histogram(Arc<AtomicBucket<f64>>)

A histogram.

Implementations

Creates a counter handle.

The counter is initialized to 0.

Creates a gauge handle.

The gauge is initialized to 0.

Creates a histogram handle.

The histogram handle is initialized to empty.

Increments this handle as a counter.

Panics if this handle is not a counter.

Updates this handle as a gauge.

Panics if this handle is not a gauge.

Records to this handle as a histogram.

Panics if this handle is not a histogram.

Reads this handle as a counter.

Panics if this handle is not a counter.

Reads this handle as a gauge.

Panics if this handle is not a gauge.

Reads this handle as a histogram.

Panics if this handle is not a histogram.

Reads this handle as a histogram, and whether or not it’s empty.

Panics if this handle is not a histogram.

Reads this handle as a histogram incrementally into a closure, and clears the histogram.

The closure f passed in is invoked multiple times with slices of values present in the histogram currently. Once all values have been read, the histogram is cleared of all values.

Panics if this handle is not a histogram.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. 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

Performs the conversion.

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

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.