Module Ui_metrics.Histogram

module Buckets : sig ... end
type 'a t = {
  1. buckets : 'a Buckets.t;
  2. counts : int array;
  3. mutable sum : 'a;
  4. mutable min : 'a option;
  5. mutable max : 'a option;
}

A JSOO-compatible histogram type that has the same semantics as Prometheus_instrumentation_collector.Histogram.t.

val sexp_of_t : ('a -> Sexplib0.Sexp.t) -> 'a t -> Sexplib0.Sexp.t
include Ppx_compare_lib.Equal.S1 with type 'a t := 'a t
val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool
val create : buckets:'a Buckets.t -> unit -> 'a t
val observe : 'a t -> 'a -> unit

observe t datum adds a recording of datum to the histogram t with frequency one. It finds the bucket in which the value observed resides and increments only that bucket.

val clone : 'a t -> 'a t

Returns a copy of the histogram that can be mutated separately.

module type S = sig ... end
val module_of_histogram : 'a Buckets.Type.t -> (module S with type t = 'a)
module For_sexp : sig ... end