Struct metrics_util::DebuggingRecorder
source · [−]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
sourceimpl DebuggingRecorder
impl DebuggingRecorder
sourcepub fn new() -> DebuggingRecorder
pub fn new() -> DebuggingRecorder
Creates a new DebuggingRecorder
.
sourcepub fn snapshotter(&self) -> Snapshotter
pub fn snapshotter(&self) -> Snapshotter
Gets a Snapshotter
attached to this recorder.
sourcepub fn install(self) -> Result<(), SetRecorderError>
pub fn install(self) -> Result<(), SetRecorderError>
Installs this recorder as the global recorder.
Trait Implementations
sourceimpl Default for DebuggingRecorder
impl Default for DebuggingRecorder
sourceimpl Recorder for DebuggingRecorder
impl Recorder for DebuggingRecorder
sourcefn describe_counter(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
fn describe_counter(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
Describes a counter. Read more
sourcefn describe_gauge(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
fn describe_gauge(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
Describes a gauge. Read more
sourcefn describe_histogram(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
fn describe_histogram(
&self,
key: KeyName,
unit: Option<Unit>,
description: &'static str
)
Describes a histogram. Read more
sourcefn register_counter(&self, key: &Key) -> Counter
fn register_counter(&self, key: &Key) -> Counter
Registers a counter.
sourcefn register_gauge(&self, key: &Key) -> Gauge
fn register_gauge(&self, key: &Key) -> Gauge
Registers a gauge.
sourcefn register_histogram(&self, key: &Key) -> Histogram
fn register_histogram(&self, key: &Key) -> Histogram
Registers a histogram.
Auto Trait Implementations
impl !RefUnwindSafe for DebuggingRecorder
impl Send for DebuggingRecorder
impl Sync for DebuggingRecorder
impl Unpin for DebuggingRecorder
impl !UnwindSafe for DebuggingRecorder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more