Module Metrics.Data

Data defines what is stored in the time series.

Data

type t

The type for data points.

type timestamp = string

The type for timestamp. A timestamp shows the date and time, in RFC3339 UTC, associated with particular data.

val timestamp : t -> timestamp option

timestamp t is t's timestamp (if any). If it is None, then the reporter will add a new timestamp automatically.

val v : ?⁠timestamp:timestamp -> field list -> t

v ?timestamp f is the measure f, as a the list metric name and value, and the timestamp timestamp. If timestamp is not provided, it will be set be the reporter. Raise Invalid_argument is a key or a value contains an invalid character.

val keys : t -> key list

keys t is t's keys.

val fields : t -> field list

fields t is t's fields.

val cons : field -> t -> t

cons f t is the new data having the same timestamp as t and the fields f :: fields t.