Module type Metrics.METRICS

Module that represents an instrument to take and save mesures.

val insert : string -> string -> [< `Start | `Stop ] -> unit Lwt.t

insert file fun_name state inserts a new entry into the database, referenced as file.fun_name. It's either the starting of a measure or the end.

val exist : string -> string -> bool

exist file fun_name checks if there is already a reference to file.fun_name in the database.

val generate_report : string -> string -> unit Lwt.t

generate_report path name builds a JSON report to path/name from the values present in the database. It creates the path if it doesn't exist.

val generate_report_on_signal : string -> string -> unit Lwt.t

generate_report_on_signal path name is the same as generate_report with, in addition, a mecanism to refill the queue with a value. We want to keep the report structure consistent.