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]

Creates a new Configuration with default values.

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.

Sets the batch size.

Defaults to 128.

All Sources 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.

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.

Create a Sink based on this configuration.

Trait Implementations

impl<T: Clone> Clone for Configuration<T>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T> Default for Configuration<T>
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<T> Send for Configuration<T> where
    T: Send

impl<T> Sync for Configuration<T> where
    T: Sync