mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-12 05:26:17 -04:00
simplify
This commit is contained in:
parent
276ba2efd1
commit
020de6887a
2 changed files with 2 additions and 11 deletions
|
|
@ -569,11 +569,7 @@ let setup_ ?stop ?config () =
|
||||||
let backend = create_backend ?stop ?config () in
|
let backend = create_backend ?stop ?config () in
|
||||||
let (module B : OT.Collector.BACKEND) = backend in
|
let (module B : OT.Collector.BACKEND) = backend in
|
||||||
OT.Collector.set_backend backend;
|
OT.Collector.set_backend backend;
|
||||||
let cleanup () =
|
OT.Collector.remove_backend
|
||||||
B.tick ();
|
|
||||||
B.cleanup ()
|
|
||||||
in
|
|
||||||
cleanup
|
|
||||||
|
|
||||||
let setup ?stop ?config ?(enable = true) () =
|
let setup ?stop ?config ?(enable = true) () =
|
||||||
if enable then (
|
if enable then (
|
||||||
|
|
|
||||||
|
|
@ -508,12 +508,7 @@ let setup_ ?(stop = Atomic.make false) ?(config : Config.t = Config.make ()) ()
|
||||||
let sleep_ms = min 60_000 (max 2 config.ticker_interval_ms) in
|
let sleep_ms = min 60_000 (max 2 config.ticker_interval_ms) in
|
||||||
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
|
ignore (setup_ticker_thread ~stop ~sleep_ms backend () : Thread.t)
|
||||||
);
|
);
|
||||||
|
OT.Collector.remove_backend
|
||||||
let cleanup () =
|
|
||||||
B.tick ();
|
|
||||||
B.cleanup ()
|
|
||||||
in
|
|
||||||
cleanup
|
|
||||||
|
|
||||||
let setup ?stop ?config ?(enable = true) () =
|
let setup ?stop ?config ?(enable = true) () =
|
||||||
if enable then (
|
if enable then (
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue