pub struct Metrics { /* private fields */ }
Expand description
Provides access to all registered metrics both static and dynamic.
IMPORTANT: Note that while any instance of this struct is live
attempting to register or unregister any dynamic metrics will block.
If this is done on the same thread as is currently working with an instance
of Metrics
then it will cause a deadlock. If your application will be
registering and unregistering dynamic metrics then you should avoid holding
on to Metrics
instances for long periods of time.
Metrics
instances can be created via the metrics
function.
Implementations§
source§impl Metrics
impl Metrics
sourcepub fn static_metrics(&self) -> &'static [MetricEntry]
pub fn static_metrics(&self) -> &'static [MetricEntry]
A list containing all metrics that were registered via the [metric
]
attribute macro.
Note that the entries may be in any order and that this order may change depending on compiler settings and the linker you are using.
sourcepub fn dynamic_metrics(&self) -> DynMetricsIter<'_> ⓘ
pub fn dynamic_metrics(&self) -> DynMetricsIter<'_> ⓘ
A list containing all metrics that were dynamically registered.