mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-09 12:23:32 -04:00
small refactor
This commit is contained in:
parent
053493db8b
commit
84be273b76
1 changed files with 4 additions and 3 deletions
|
|
@ -225,14 +225,15 @@ end = struct
|
|||
|
||||
let push (self : _ t) x : bool =
|
||||
let@ () = with_mutex_ self.lock in
|
||||
if self.size = 0 && Option.is_some self.timeout then
|
||||
(* current batch starts now *)
|
||||
self.start <- Mtime_clock.now ();
|
||||
if self.size >= self.high_watermark then (
|
||||
(* drop this to prevent queue from growing too fast *)
|
||||
Atomic.incr n_dropped;
|
||||
true
|
||||
) else (
|
||||
if self.size = 0 && Option.is_some self.timeout then
|
||||
(* current batch starts now *)
|
||||
self.start <- Mtime_clock.now ();
|
||||
|
||||
(* add to queue *)
|
||||
self.size <- 1 + self.size;
|
||||
self.q <- x :: self.q;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue