method metric.counter
A counter (a value that only grows); name it ..._total. The same name and labels give the same series.
Example:
use std.obs { metric }
fn main() io {
let c = metric.counter("requests_total", "requests served")
c.inc()
c.add(2.0)
print("{c.value()}")
}Output
3.0
pub(api) static fn counter(name: str, help: str = "", labels: Map<str, str> = {:}) -> Counter ioSince. 1.0.0-beta
Parameters
| Name | Type |
|---|---|
name | str |
help | str = "" |
labels | Map<str, str> = {:} |
Returns
Effects
io
Defined in: std/obs/obs.oxl:803