mirror of
https://github.com/ocaml-tracing/ocaml-trace.git
synced 2026-03-07 18:37:56 -05:00
tef: emit last message when worker exits
This commit is contained in:
parent
721212be27
commit
079949d139
1 changed files with 5 additions and 0 deletions
|
|
@ -328,6 +328,11 @@ let bg_thread ~out (events : event B_queue.t) : unit =
|
|||
List.iter handle_ev local
|
||||
done
|
||||
with B_queue.Closed ->
|
||||
(* write a message about us closing *)
|
||||
Writer.emit_instant_event ~name:"tef-worker.exit"
|
||||
~tid:(Thread.id @@ Thread.self ())
|
||||
~ts:(now_us ()) ~args:[] writer;
|
||||
|
||||
(* warn if app didn't close all spans *)
|
||||
if Span_tbl.length spans > 0 then
|
||||
Printf.eprintf "trace-tef: warning: %d spans were not closed\n%!"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue