Struct metrics_printer::PrintRecorder[][src]

pub struct PrintRecorder<P> where
    P: Printer + Send + Sync + 'static, 
{ /* fields omitted */ }

A metrics recorder that collects metrics and regularly tried to print them.

Implementations

impl<P> PrintRecorder<P> where
    P: Printer + Send + Sync + 'static, 
[src]

pub fn new(printer: P) -> Self[src]

New PrinterRecorder with 1s interval no metadata printing.

pub fn set_print_interval(&mut self, interval: Duration) -> &mut Self[src]

Set how often metrics should be printed (roughly)

pub fn do_print_medata(&mut self) -> &mut Self[src]

Print units and descriptions together with the metrics

pub fn skip_print_medata(&mut self) -> &mut Self[src]

Do not print units and descriptions together with the metrics

pub fn select_quantiles(&mut self, quantiles: Box<[Quantile]>) -> &mut Self[src]

Select which quantiles should be printed

pub fn install_if_free(self)[src]

Register this recorder as the global recorder, if no other recorder is already registered.

If another recorder is registered, this will fail silently. This method is recommended to be used when you are trying to set the exact same recorder from multiple places and don’t know/care which will get executed first. This is often the case for unit tests, for example.

Also starts the background thread for printing.

pub fn install(self) -> Result<(), SetRecorderError>[src]

Register this recorder as the global recorder, if no other recorder is already registered.

If another recorder is registered, this will return an error.

Also starts the background thread for printing.

Trait Implementations

impl Default for PrintRecorder<StdoutPrinter>[src]

fn default() -> Self[src]

New PrinterRecorder to stdout with 1s interval no metadata printing.

Auto Trait Implementations

impl<P> !RefUnwindSafe for PrintRecorder<P>

impl<P> Send for PrintRecorder<P>

impl<P> Sync for PrintRecorder<P>

impl<P> Unpin for PrintRecorder<P> where
    P: Unpin

impl<P> !UnwindSafe for PrintRecorder<P>

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> From<T> for T[src]

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

impl<T> Pointable for T

type Init = T

The type for initializers.

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.