Closed mniak closed 4 years ago
Hi @mniak,
I beleive it is by design. Technically there is a contract (OnEmpyBatch) that should be respected when there are no events in the batch.
It wasn't designed to work with periods around the delta of zero. The whole point of this is to offload sending burst of events with batches and at ~constant pace.
/// Allows derived sinks to perform periodic work without requiring additional threads /// or timers (thus avoiding additional flush/shut-down complexity).
Oh, I see. Thank you very much for the attention!
I think the timer should be disable when there ar no more events to be written/sent/emmited.
In a recent problem described in #43 (totally my fault) I got to perceive that the class
PeridodicBatchingSink
continues running even when there are no more events.The High CPU Usage problem I was facing was due to
period
being informedTimeSpan.Zero
. While I assume this was my fault, there were no reason to the timer to keep running when the log event count reaches zero.It should be started again when next event comes.
Is this behavior by-design? Would it make any sense to improve this like described?
Thanks!