#[metric]
Expand description
Declare a global metric that can be accessed via the metrics
method.
Note that this will change the type of the generated static to be
MetricInstance<MetricTy>
. It implements both Deref
and DerefMut
so it can be used much the same as a normal static.
§Parameters
- (optional)
crate
: The path to themetriken
crate. This allows themetric
macro to be used within other macros that get exported to third-party crates which may not have addedmetriken
to their Cargo.toml. - (optional)
formatter
: A function to be used to determine the output name for this metric.