Skip to main content

SampleSink

Trait SampleSink 

Source
pub trait SampleSink {
    // Required methods
    fn push_float(&mut self, ts: i64, value: f64);
    fn push_int_histogram(&mut self, h: &IntHistogramSample<'_>);
    fn push_float_histogram(&mut self, h: &FloatHistogramSample<'_>);
}
Expand description

Receives decoded samples in time order.

chunkenc::decode calls these once per sample, without allocating; the sink is where an export writes rows or forwards them to another system. Integer and float histograms have separate methods so a sink never has to guess whether the counts it receives are exact.

Required Methods§

Source

fn push_float(&mut self, ts: i64, value: f64)

A float sample. NaNs, including Prometheus stale markers, are passed through unchanged.

Source

fn push_int_histogram(&mut self, h: &IntHistogramSample<'_>)

An integer native histogram sample. Counts are exact u64/i64.

Source

fn push_float_histogram(&mut self, h: &FloatHistogramSample<'_>)

A float native histogram sample. The borrow ends when the call returns.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§