penumbra_sdk_app

Module metrics

Source
Expand description

Crate-specific metrics functionality.

This module re-exports the contents of the metrics crate. This is effectively a way to monkey-patch the functions in this module into the metrics crate, at least from the point of view of the other code in this crate.

Code in this crate that wants to use metrics should use crate::metrics;, so that this module shadows the metrics crate.

This trick is probably good to avoid in general, because it could be confusing, but in this limited case, it seems like a clean option.

Modules§

atomics
Atomic types used for metrics.

Macros§

counter
Registers a counter.
describe_counter
Describes a counter.
describe_gauge
Describes a gauge.
describe_histogram
Describes a histogram.
gauge
Registers a gauge.
histogram
Registers a histogram.

Structs§

Counter
A counter.
Gauge
A gauge.
Histogram
A histogram.
Key
A metric identifier.
KeyHasher
Key-specific hashing algorithm.
KeyName
Name component of a key.
Label
Metadata for a metric key in the form of a key/value pair.
Level
Verbosity of a metric.
LocalRecorderGuard
Guard for setting a local recorder.
Metadata
Metadata describing a metric.
NoopRecorder
A no-op recorder.
SetRecorderError
Error returned when trying to install a global recorder when another has already been installed.

Enums§

GaugeValue
Value of a gauge operation.
Unit
Units for a given metric.

Constants§

MEMPOOL_CHECKTX_TOTAL

Traits§

CounterFn
A counter handler.
GaugeFn
A gauge handler.
HistogramFn
A histogram handler.
IntoF64
An object which can be converted into a f64 representation.
IntoLabels
A value that can be converted to a vector of Labels.
Recorder
A trait for registering and recording metrics.

Functions§

register_metrics
Registers all metrics used by this crate.
set_default_local_recorder
Sets the recorder as the default for the current thread for the duration of the lifetime of the returned LocalRecorderGuard.
set_global_recorder
Sets the global recorder.
with_local_recorder
Runs the closure with the given recorder set as the global recorder for the duration.
with_recorder
Runs the closure with a reference to the current recorder for this scope.

Type Aliases§

SharedString
An allocation-optimized string.