macro_rules! count {
($name:literal $(, $tag:ident = $tv:expr)* $(,)?) => { ... };
($name:literal += $value:expr $(, $tag:ident = $tv:expr)* $(,)?) => { ... };
}Expand description
Increments a counter metric.
ยงSyntax
use objectstore_metrics::count;
// Shorthand: increments by 1
count!("server.start");
count!("server.requests", route = "/v1/test", method = "GET");
// Explicit increment value
count!("server.requests" += 5);
count!("server.requests" += 5, route = "/v1/test");Tag keys are identifiers; tag values must implement Into<SharedString>
(use .to_string() for integers or non-string types).