pub struct AdaptiveBatcher { /* private fields */ }Expand description
Adaptive batch size calculator.
Tracks recent ingestion velocity and adjusts batch size accordingly.
Implementations§
Source§impl AdaptiveBatcher
impl AdaptiveBatcher
Sourcepub fn new(config: BatchConfig) -> Self
pub fn new(config: BatchConfig) -> Self
Create a new adaptive batcher.
Sourcepub fn record_events(&mut self, count: usize) -> usize
pub fn record_events(&mut self, count: usize) -> usize
Record events and get the current target batch size.
Call this each time events are drained from the ring buffer.
Sourcepub fn batch_size(&self) -> usize
pub fn batch_size(&self) -> usize
Get the current target batch size.
Auto Trait Implementations§
impl Freeze for AdaptiveBatcher
impl RefUnwindSafe for AdaptiveBatcher
impl Send for AdaptiveBatcher
impl Sync for AdaptiveBatcher
impl Unpin for AdaptiveBatcher
impl UnsafeUnpin for AdaptiveBatcher
impl UnwindSafe for AdaptiveBatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more