[−][src]Struct hdrhistogram::serialization::interval_log::IntervalLogWriter
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
Methods
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]
&mut self,
h: &Histogram<T>,
start_timestamp: Duration,
duration: Duration,
tag: Option<Tag>
) -> Result<(), IntervalLogWriterError<S::SerializeError>>
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> Send for IntervalLogWriter<'a, 'b, W, S> where
S: Send,
W: Send,
S: Send,
W: Send,
impl<'a, 'b, W, S> Sync for IntervalLogWriter<'a, 'b, W, S> where
S: Sync,
W: Sync,
S: Sync,
W: Sync,
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,