data Counter
A value that only grows (requests served, errors). Name it …_total.
Example:
use std.obs { metric }
fn main() io {
let c = metric.counter("requests_total", "requests served")
c.inc()
c.add(2)
print("{c.value()}")
}Output
3.0
pub(api) data CounterThread safety. safe from any task; updates are atomic.
Since. 1.0.0-beta
Methods
inc | () ioAdds 1. |
add | (n: f64) ioAdds n (>= 0; a negative amount is ignored). |
value | () -> f64 ioCurrent value. |
Defined in: std/obs/obs.oxl:518