mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
metrics: use main clock by default for data points
This commit is contained in:
parent
e97088f6f7
commit
a28f24d14f
1 changed files with 4 additions and 4 deletions
|
|
@ -16,15 +16,15 @@ type t = Metrics.metric
|
||||||
let pp = Proto.Metrics.pp_metric
|
let pp = Proto.Metrics.pp_metric
|
||||||
|
|
||||||
(** Number data point, as a float *)
|
(** Number data point, as a float *)
|
||||||
let float ?start_time_unix_nano ?(attrs = []) ~(now : Timestamp_ns.t)
|
let float ?start_time_unix_nano ?(attrs = []) ?(now = Clock.now_main ())
|
||||||
(d : float) : number_data_point =
|
(d : float) : number_data_point =
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
||||||
~value:(As_double d) ()
|
~value:(As_double d) ()
|
||||||
|
|
||||||
(** Number data point, as an int *)
|
(** Number data point, as an int *)
|
||||||
let int ?start_time_unix_nano ?(attrs = []) ~(now : Timestamp_ns.t) (i : int) :
|
let int ?start_time_unix_nano ?(attrs = []) ?(now = Clock.now_main ()) (i : int)
|
||||||
number_data_point =
|
: number_data_point =
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
make_number_data_point ?start_time_unix_nano ~time_unix_nano:now ~attributes
|
||||||
~value:(As_int (Int64.of_int i))
|
~value:(As_int (Int64.of_int i))
|
||||||
|
|
@ -61,7 +61,7 @@ type histogram_data_point = Metrics.histogram_data_point
|
||||||
length 0)
|
length 0)
|
||||||
@param explicit_bounds strictly increasing list of bounds for the buckets *)
|
@param explicit_bounds strictly increasing list of bounds for the buckets *)
|
||||||
let histogram_data_point ?start_time_unix_nano ?(attrs = []) ?(exemplars = [])
|
let histogram_data_point ?start_time_unix_nano ?(attrs = []) ?(exemplars = [])
|
||||||
~explicit_bounds ?sum ~(now : Timestamp_ns.t) ~bucket_counts ~count () :
|
~explicit_bounds ?sum ?(now = Clock.now_main ()) ~bucket_counts ~count () :
|
||||||
histogram_data_point =
|
histogram_data_point =
|
||||||
let attributes = attrs |> List.map Key_value.conv in
|
let attributes = attrs |> List.map Key_value.conv in
|
||||||
make_histogram_data_point ?start_time_unix_nano ~time_unix_nano:now
|
make_histogram_data_point ?start_time_unix_nano ~time_unix_nano:now
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue