Prometheus.GaugeA gauge is a metric that represents a single numerical value that can arbitrarily go up and down.
include METRICA collection of metrics that are the same except for their labels. e.g. "Number of HTTP responses"
val v_labels :
label_names:string list ->
?registry:CollectorRegistry.t ->
help:string ->
?namespace:string ->
?subsystem:string ->
string ->
familyv_labels ~label_names ~help ~namespace ~subsystem name is a family of metrics with full name namespace_subsystem_name and documentation string help. Each metric in the family will provide a value for each of the labels. The new family is registered with registry (default: CollectorRegistry.default).
labels family label_values is the metric in family with these values for the labels. The order of the values must be the same as the order of the label_names passed to v_labels; you may wish to write a wrapper function with labelled arguments to avoid mistakes. If this is called multiple times with the same set of values, the existing metric will be returned.
val v_label :
label_name:string ->
?registry:CollectorRegistry.t ->
help:string ->
?namespace:string ->
?subsystem:string ->
string ->
string ->
tv_label is a convenience wrapper around v_labels for the case where there is a single label. The result is a function from the single label's value to the metric.
val v :
?registry:CollectorRegistry.t ->
help:string ->
?namespace:string ->
?subsystem:string ->
string ->
tv is a convenience wrapper around v_labels for the case where there are no labels.
val clear : family -> unitclear will clean every metric that was sent.
val clear_specific : family -> string list -> unitclear_specific t labels will clear a specific metric t that matches the given labels.
val read : t -> floatval inc_one : t -> unitval inc : t -> float -> unitinc t v increases the current value of the guage by v.
val dec_one : t -> unitval dec : t -> float -> unitdec t v decreases the current value of the guage by v.
val set : t -> float -> unitset t v sets the current value of the guage to v.
val track_inprogress : t -> (unit -> 'a Lwt.t) -> 'a Lwt.ttrack_inprogress t f increases the value of the gauge by one while f () is running.
val time : t -> (unit -> float) -> (unit -> 'a Lwt.t) -> 'a Lwt.ttime t gettime f calls gettime () before and after executing f () and increases the metric by the difference.