fix: emit traces, too

This commit is contained in:
Simon Cruanes 2022-04-12 13:50:50 -04:00
parent 3f3a39eee7
commit 2c1c67bfe8
No known key found for this signature in database
GPG key ID: EBFFF6F283F3A2B4

View file

@ -399,22 +399,24 @@ let mk_emitter ~(config:Config.t) () : (module EMITTER) =
if force || (not force && E_metrics.is_big_enough ()) then (
let batch = ref [AList.pop_all gc_metrics] in
E_metrics.pop_iter_all (fun l -> batch := l :: !batch);
if not (batch_is_empty !batch) then (
let do_something = not (l_is_empty !batch) in
if do_something then (
send_metrics_http !batch;
);
Atomic.set last_wakeup (Mtime_clock.now());
true
do_something
) else false
in
let emit_traces ?(force=false) () : bool =
if force || (not force && E_trace.is_big_enough ()) then (
let batch = ref [] in
E_trace.pop_iter_all (fun l -> batch := l :: !batch);
if not (l_is_empty !batch) then (
let do_something = not (l_is_empty !batch) in
if do_something then (
send_traces_http !batch;
);
Atomic.set last_wakeup (Mtime_clock.now());
true
do_something
) else false
in