pub struct BatchConfig {
pub min_size: usize,
pub max_size: usize,
pub max_delay: Duration,
pub adaptive: bool,
pub velocity_window: Duration,
}Expand description
Batch aggregation configuration.
Fields§
§min_size: usizeMinimum batch size (floor for adaptive sizing). Default: 1,000 events.
max_size: usizeMaximum batch size (ceiling for adaptive sizing). Default: 10,000 events.
max_delay: DurationMaximum time to wait before flushing a partial batch. Default: 10ms.
adaptive: boolEnable adaptive batch sizing based on ingestion velocity. Default: true.
velocity_window: DurationWindow size for velocity calculation (adaptive mode). Default: 100ms.
Implementations§
Source§impl BatchConfig
impl BatchConfig
Sourcepub const MAX_BATCH_SIZE_LIMIT: usize = 1_000_000
pub const MAX_BATCH_SIZE_LIMIT: usize = 1_000_000
Upper bound on max_size. The adaptive-batching code in
shard/batch.rs uses arithmetic like
current_batch_size * 3 + target against max_size-clamped
values; with max_size = usize::MAX the multiplication
panics in debug builds and wraps in release. The default
production max_size = 10_000 is far below this cap, so
this is purely a hostile-config guard. Set well above any
plausible workload (high_throughput ships 50_000) but
well below the arithmetic-blast radius.
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the batch configuration.
Sourcepub fn high_throughput() -> Self
pub fn high_throughput() -> Self
Create a high-throughput configuration optimized for Blackwell workloads.
Sourcepub fn low_latency() -> Self
pub fn low_latency() -> Self
Create a low-latency configuration for interactive workloads.
Trait Implementations§
Source§impl Clone for BatchConfig
impl Clone for BatchConfig
Source§fn clone(&self) -> BatchConfig
fn clone(&self) -> BatchConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more