Struct hdrhistogram::serialization::interval_log::IntervalLogWriter[][src]

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

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 hdrhistogram::serialization;
use hdrhistogram::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

impl<'a, 'b, W: 'a + Write, S: 'b + Serializer> IntervalLogWriter<'a, 'b, W, S>[src]

pub fn write_comment(&mut self, s: &str) -> Result<()>[src]

Write a comment line.

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

pub fn write_histogram<T: Counter>(
    &mut self,
    h: &Histogram<T>,
    start_timestamp: Duration,
    duration: Duration,
    tag: Option<Tag<'_>>
) -> Result<(), IntervalLogWriterError<S::SerializeError>>
[src]

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

impl<'a, 'b, W, S> RefUnwindSafe for IntervalLogWriter<'a, 'b, W, S> where
    S: RefUnwindSafe,
    W: RefUnwindSafe

impl<'a, 'b, W, S> Send for IntervalLogWriter<'a, 'b, W, S> where
    S: Send,
    W: Send

impl<'a, 'b, W, S> Sync for IntervalLogWriter<'a, 'b, W, S> where
    S: Sync,
    W: Sync

impl<'a, 'b, W, S> Unpin for IntervalLogWriter<'a, 'b, W, S>

impl<'a, 'b, W, S> !UnwindSafe for IntervalLogWriter<'a, 'b, W, S>

Blanket Implementations

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

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

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

impl<T> Conv for T

impl<T> Conv for T

impl<T> FmtForward for T

impl<T> From<T> for T[src]

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

impl<T> Pipe for T where
    T: ?Sized

impl<T> Pipe for T

impl<T> PipeAsRef for T

impl<T> PipeBorrow for T

impl<T> PipeDeref for T

impl<T> PipeRef for T

impl<T> Tap for T

impl<T> Tap for T

impl<T, U> TapAsRef<U> for T where
    U: ?Sized

impl<T, U> TapBorrow<U> for T where
    U: ?Sized

impl<T> TapDeref for T

impl<T> TryConv for T

impl<T> TryConv for T

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.