mirror of
https://github.com/ocaml-tracing/ocaml-opentelemetry.git
synced 2026-03-08 03:47:59 -04:00
fix batch: default high watermark was wrong
This commit is contained in:
parent
173131ce84
commit
0eb27174f0
1 changed files with 4 additions and 3 deletions
|
|
@ -13,7 +13,7 @@ type 'a t = {
|
|||
timeout: Mtime.span option;
|
||||
}
|
||||
|
||||
let default_high_watermark batch_size = min 10 (max (batch_size * 10) 1_000_000)
|
||||
let default_high_watermark batch_size = max 10 (min (batch_size * 10) 1_000_000)
|
||||
|
||||
let _dummy_start = Mtime.min_stamp
|
||||
|
||||
|
|
@ -83,8 +83,9 @@ let push (self : _ t) elems : [ `Dropped | `Ok ] =
|
|||
let now = lazy (Mtime_clock.now ()) in
|
||||
Util_atomic.update_cas self.st @@ fun state ->
|
||||
if state.size >= self.high_watermark then
|
||||
(* drop this to prevent queue from growing too fast *)
|
||||
`Dropped, state
|
||||
( (* drop this to prevent queue from growing too fast *)
|
||||
`Dropped,
|
||||
state )
|
||||
else (
|
||||
let start =
|
||||
if state.size = 0 && Option.is_some self.timeout then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue