mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-08 03:47:57 -04:00
break tef: use mtime.now, not a counter, for multiproc
this allows us to correlate timestamps among processes on the same machine.
This commit is contained in:
parent
5b677e5cdd
commit
ff8c7e5353
1 changed files with 2 additions and 4 deletions
|
|
@ -15,15 +15,13 @@ module Mock_ = struct
|
||||||
float_of_int x
|
float_of_int x
|
||||||
end
|
end
|
||||||
|
|
||||||
let counter = Mtime_clock.counter ()
|
|
||||||
|
|
||||||
(** Now, in microseconds *)
|
(** Now, in microseconds *)
|
||||||
let[@inline] now_us () : float =
|
let[@inline] now_us () : float =
|
||||||
if !Mock_.enabled then
|
if !Mock_.enabled then
|
||||||
Mock_.now_us ()
|
Mock_.now_us ()
|
||||||
else (
|
else (
|
||||||
let t = Mtime_clock.count counter in
|
let t = Mtime_clock.now () in
|
||||||
Mtime.Span.to_float_ns t /. 1e3
|
Int64.to_float (Mtime.to_uint64_ns t) /. 1e3
|
||||||
)
|
)
|
||||||
|
|
||||||
let on_tracing_error = ref (fun s -> Printf.eprintf "trace-tef error: %s\n%!" s)
|
let on_tracing_error = ref (fun s -> Printf.eprintf "trace-tef error: %s\n%!" s)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue