[][src]Struct hotmic::Configuration

pub struct Configuration<T> { /* fields omitted */ }

A configuration builder for Receiver.

Methods

impl<T: Send + Eq + Hash + Display + Clone> Configuration<T>[src]

pub fn new() -> Configuration<T>[src]

Creates a new Configuration with default values.

pub fn capacity(self, capacity: usize) -> Self[src]

Sets the buffer capacity.

Defaults to 512.

This controls the size of the channel used to send metrics. This channel is shared amongst all active sinks. If this channel is full when sending a metric, that send will be blocked until the channel has free space.

Tweaking this value allows for a trade-off between low memory consumption and throughput burst capabilities. By default, we expect samples to occupy approximately 64 bytes. Thus, at our default value, we preallocate roughly ~32KB.

Generally speaking, sending and processing metrics is fast enough that the default value of 4096 supports millions of samples per second.

pub fn batch_size(self, batch_size: usize) -> Self[src]

Sets the batch size.

Defaults to 64.

This controls the size of message batches that we collect for processing. The only real reason to tweak this is to control the latency from the sender side. Larger batches lower the ingest latency in the face of high metric ingest pressure at the cost of higher tail latencies.

Long story short, you shouldn't need to change this, but it's here if you really do.

pub fn histogram(self, window: Duration, granularity: Duration) -> Self[src]

Sets the histogram configuration.

Defaults to a 10 second window with 1 second granularity.

This controls how long of a time frame the histogram will track, on a rolling window. We'll create enough underlying histogram buckets so that we have (window / granularity) buckets, and every interval that passes (granularity), we'll add a new bucket and drop the oldest one, thereby providing a rolling window.

Histograms, under the hood, are hard-coded to track three significant digits, and will take a theoretical maximum of around 60KB per bucket, so a single histogram metric with the default window/granularity will take a maximum of around 600KB.

In practice, this should be much smaller based on the maximum values pushed into the histogram, as the underlying histogram storage is automatically resized on the fly.

pub fn percentiles(self, percentiles: &[f64]) -> Self[src]

Sets the default percentiles for histograms.

Defaults to min/p50/p95/p99/p999/max.

This controls the percentiles we extract from histograms when taking a snapshot. Percentiles are represented in metrics as pXXX, where XXX is the percentile i.e. p99 is 99.0, p999 is 99.9, etc. min and max are 0.0 and 100.0, respectively.

pub fn build(self) -> Receiver<T>[src]

Create a Receiver based on this configuration.

Trait Implementations

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

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

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

Auto Trait Implementations

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

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

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Erased for T