OxL Reference

data Histogram

A distribution (latencies, sizes) counted into buckets.

Example:

oxl✓ checked in CI
use std.obs { metric }

fn main() io {
  let h = metric.histogram("latency_seconds", "request latency", [0.1, 0.5, 1.0])
  h.observe(0.25)
  h.observe(0.7)
  print("{h.count()}")
}
Output
2.0
pub(api) data Histogram

Thread safety. safe from any task; observations are atomic.

Since. 1.0.0-beta

Methods

observe(v: f64) io
Records one observation.
count() -> f64 io
Number of observations so far.

Defined in: std/obs/obs.oxl:722

See also