Module Tiny_httpd_prometheus.Registry

Registry for metrics.

type t

The registry contains a group of metrics

val create : unit -> t
val on_will_emit : t -> (unit -> unit) -> unit

on_will_emit registry f calls f() every time emit buf registry is called (before the metrics start being emitted). This is useful to update some metrics on demand.

val emit : Stdlib.Buffer.t -> t -> unit

Write metrics into the given buffer. The buffer will be cleared first thing.

val emit_str : t -> string