macro_rules! describe_gauge {
($name:expr, $unit:expr, $description:expr $(,)?) => { ... };
($name:expr, $description:expr $(,)?) => { ... };
}Expand description
Describes a gauge.
Gauges represent a single value that can go up or down over time, and always starts out with an initial value of zero.
Gauges can be described with a free-form string, and optionally, a unit can be provided to describe the value and/or rate of the measurements. Whether or not the installed recorder does anything with the description, or optional unit, is implementation defined.
ยงExample
// A basic gauge:
describe_gauge!("some_metric_name", "my favorite gauge");
// Providing a unit for a gauge:
describe_gauge!("some_metric_name", Unit::Bytes, "my favorite gauge");
// As mentioned in the documentation, metric names also can be owned strings, including ones
// generated at the callsite via things like `format!`:
let name = String::from("some_owned_metric_name");
describe_gauge!(name, "my favorite gauge");
describe_gauge!(format!("{}_via_format", "name"), "my favorite gauge");