Struct hotmic::Configuration [−][src]
pub struct Configuration<T> { /* fields omitted */ }
A configuration builder for Sink
.
Methods
impl<T: Send + Eq + Hash + Display + Debug + Clone> Configuration<T>
[src]
impl<T: Send + Eq + Hash + Display + Debug + Clone> Configuration<T>
pub fn new() -> Configuration<T>
[src]
pub fn new() -> Configuration<T>
Creates a new Configuration
with default values.
pub fn capacity(self, capacity: usize) -> Self
[src]
pub fn capacity(self, capacity: usize) -> Self
Sets the buffer capacity.
Defaults to 128
.
This controls how many buffers are pre-allocated, and conversely, how many buffers are able
to be sent into the data channel without blocking. If all buffers are consumed, any send
activity by a Source
will block until a buffer is returned and made available.
Tweaking this value allows for controlling the trade-off between memory consumption -- as all buffers are preallocated -- and throughput burst capabilities as a burst of metrics could quickly empty the buffer list and cause blocking.
Generally speaking, sending and processing metrics is fast enough that the default value of 128 supports hundreds of thousands of samples per second.
pub fn batch_size(self, batch_size: usize) -> Self
[src]
pub fn batch_size(self, batch_size: usize) -> Self
Sets the batch size.
Defaults to 128
.
All Source
s will internally buffer up to batch_size
samples before sending them to the
Sink
.
The default batch size of 128 was chosen empirically to support a near-theoretical
throughput limit given the work the Sink
will do every every sample processed. It will
work very well if you have a high enough rate of metrics to continually flush the buffers,
allowing you extremely low overhead and responsiveness.
If your metric rate per Source
is low, or infrequent, or you want all metrics to have
real-time values shown in snapshots, you should change this to a lower number.
Batch sizes of 1 to 8 will provide roughly 425k samples/second of throughput per item, so 425k/samples sec for batch=1, 850k samples/sec for batch=2, and so on.
pub fn poll_delay(self, poll_delay: Option<Duration>) -> Self
[src]
pub fn poll_delay(self, poll_delay: Option<Duration>) -> Self
Sets the poll delay.
Defaults to 100ms
.
This controls the timeout that is used internal for polling the various data and control channels. This should normally not be changed from default, as we depend on a regular cadence of cooperative yielding to be able to perform upkeep on histograms.
pub fn build(self) -> Sink<T>
[src]
pub fn build(self) -> Sink<T>
Create a Sink
based on this configuration.
Trait Implementations
impl<T: Clone> Clone for Configuration<T>
[src]
impl<T: Clone> Clone for Configuration<T>
fn clone(&self) -> Configuration<T>
[src]
fn clone(&self) -> Configuration<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<T> Default for Configuration<T>
[src]
impl<T> Default for Configuration<T>
fn default() -> Configuration<T>
[src]
fn default() -> Configuration<T>
Returns the "default value" for a type. Read more
Auto Trait Implementations
impl<T> Send for Configuration<T> where
T: Send,
impl<T> Send for Configuration<T> where
T: Send,
impl<T> Sync for Configuration<T> where
T: Sync,
impl<T> Sync for Configuration<T> where
T: Sync,