pub struct IntervalLogWriter<'a, 'b, W: 'a + Write, S: 'b + Serializer> { /* private fields */ }
Expand description

Writes interval histograms in an interval log.

This isn’t created directly; start with an IntervalLogWriterBuilder. Once you’ve written the headers and ended up with an IntervalLogWriter, typical usage would be to write a histogram at regular intervals (e.g. once a second).

use hdrsample::serialization;
use hdrsample::serialization::interval_log;

let mut buf = Vec::new();
let mut serializer = serialization::V2Serializer::new();

// create a writer via a builder
let mut writer = interval_log::IntervalLogWriterBuilder::new()
    .begin_log_with(&mut buf, &mut serializer)
    .unwrap();

writer.write_comment("Comment 2").unwrap();

// .. write some intervals

Implementations§

Write a comment line.

Comments containing ‘\n’ will be transformed into multiple lines of comments.

Write an interval histogram.

start_timestamp is the time since the epoch in seconds that measurements started being recorded in this interval. If you’re using a StartTime or BaseTime offset, you should instead use a delta since that time. See the discussion about timestamps in the module-level documentation.

duration is the duration of the interval in seconds.

tag is an optional tag for this histogram.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.