pub struct ThreadBrokerBuilder<C: Consumer, P: Producer> { /* private fields */ }Expand description
Builder for ThreadBroker.
Implementations§
Source§impl<C: Consumer, P: Producer> ThreadBrokerBuilder<C, P>
impl<C: Consumer, P: Producer> ThreadBrokerBuilder<C, P>
Sourcepub fn initial_producer_slots(self, slots: usize) -> Self
pub fn initial_producer_slots(self, slots: usize) -> Self
Start the producer at this many slots instead of the coarse default.
The default start is deliberately low, because growth is cheap and many workloads never need decode threads at all. A caller that already knows better — from a previous run, or from an explicit user request — can skip the climb. Still clamped to the per-input floor and the budget.
Sourcepub fn steady_state_policy(self, policy: SteadyStatePolicy) -> Self
pub fn steady_state_policy(self, policy: SteadyStatePolicy) -> Self
Choose whether a settled broker keeps watching for regime changes.
See SteadyStatePolicy for the responsiveness/overhead tradeoff.
Sourcepub fn sample_interval(self, interval: Duration) -> Self
pub fn sample_interval(self, interval: Duration) -> Self
Sourcepub fn steady_probe_interval(self, interval: Duration) -> Self
pub fn steady_probe_interval(self, interval: Duration) -> Self
Set the interval between responsive steady-state probes.
This does not change the high-resolution convergence cadence. The producer is asked to use roughly four monitoring observations per probe, subject to any accuracy floor imposed by its adapter.
Sourcepub fn warmup(self, warmup: Duration) -> Self
pub fn warmup(self, warmup: Duration) -> Self
See BrokerConfig::warmup.
Sourcepub fn smoothing_windows(self, windows: usize) -> Self
pub fn smoothing_windows(self, windows: usize) -> Self
Sourcepub fn deadband_threads(self, threads: usize) -> Self
pub fn deadband_threads(self, threads: usize) -> Self
Sourcepub fn blackout_samples(self, samples: usize) -> Self
pub fn blackout_samples(self, samples: usize) -> Self
Sourcepub fn ratify_samples(self, samples: usize) -> Self
pub fn ratify_samples(self, samples: usize) -> Self
Sourcepub fn opening_policy(self, policy: OpeningPolicy) -> Self
pub fn opening_policy(self, policy: OpeningPolicy) -> Self
Sourcepub fn regression_tolerance(self, fraction: f64) -> Self
pub fn regression_tolerance(self, fraction: f64) -> Self
Sourcepub fn resurvey_distance(self, threads: usize) -> Self
pub fn resurvey_distance(self, threads: usize) -> Self
Sourcepub fn resurvey_persistence(self, duration: Duration) -> Self
pub fn resurvey_persistence(self, duration: Duration) -> Self
Sourcepub fn resize_timeout(self, timeout: Duration) -> Self
pub fn resize_timeout(self, timeout: Duration) -> Self
Sourcepub fn min_consumer_threads(self, threads: usize) -> Self
pub fn min_consumer_threads(self, threads: usize) -> Self
Sourcepub fn min_producer_slots(self, slots: usize) -> Self
pub fn min_producer_slots(self, slots: usize) -> Self
Sourcepub fn build(self) -> Result<ThreadBroker<C, P>, BrokerConfigError>
pub fn build(self) -> Result<ThreadBroker<C, P>, BrokerConfigError>
Validate and finish.
§Errors
Rejects a budget too small to split, a zero sampling interval, and a warm-up shorter than two sampling intervals — the last because a broker that decides on one sample is deciding on the startup transient, which is the failure the warm-up exists to prevent.