pub struct DebuggingRecorder { /* private fields */ }
Expand description

A simplistic recorder that can be installed and used for debugging or testing.

Callers can easily take snapshots of the metrics at any given time and get access to the raw values.

Implementations

Creates a new DebuggingRecorder.

Creates a new DebuggingRecorder in per-thread mode.

This sends all metrics to a per-thread registry, such that the snapshotter will only see metrics emitted in the thread that the Snapshotter is used from. Additionally, as keeping a reference to the original Snapshotter around can be tricky, Snapshotter::current_thread_snapshot can be used to get all of the metrics currently present in the registry for the calling thread, if any were emitted.

Please note that this recorder must still be installed, but it can be installed multiple times (if the error from install is ignored) without clearing or removing any of the existing per-thread metrics, so it’s safe to re-create and re-install multiple times in the same test binary if necessary.

Gets a Snapshotter attached to this recorder.

Installs this recorder as the global recorder.

Trait Implementations

Returns the “default value” for a type. Read more

Describes a counter. Read more

Describes a gauge. Read more

Describes a histogram. Read more

Registers a counter.

Registers a gauge.

Registers a histogram.

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 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 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.