mz_compute::logging::compute

Type Alias Logger

Source
pub type Logger = Logger<ColumnBuilder<(Duration, ComputeEvent)>>;
Expand description

Type alias for a logger of compute events.

Aliased Type§

struct Logger { /* private fields */ }

Implementations

Source§

impl<CB> Logger<CB>
where CB: ContainerBuilder,

Source

pub fn new<F>(time: Instant, offset: Duration, action: F) -> Logger<CB>
where F: FnMut(&Duration, &mut Option<<CB as ContainerBuilder>::Container>) + 'static,

Allocates a new shareable logger bound to a write destination.

Source

pub fn log<T>(&self, event: T)
where CB: PushInto<(Duration, T)>,

Logs an event.

The event has its timestamp recorded at the moment of logging, but it may be delayed due to buffering. It will be written when the logger is next flushed, either due to the buffer reaching capacity or a direct call to flush.

This implementation borrows a shared (but thread-local) buffer of log events, to ensure that the action only sees one stream of events with increasing timestamps. This may have a cost that we don’t entirely understand.

Source

pub fn log_many<I>(&self, events: I)
where I: IntoIterator, CB: PushInto<(Duration, <I as IntoIterator>::Item)>,

Logs multiple events.

The event has its timestamp recorded at the moment of logging, but it may be delayed due to buffering. It will be written when the logger is next flushed, either due to the buffer reaching capacity or a direct call to flush.

All events in this call will have the same timestamp. This can be more performant due to fewer time.elapsed() calls, but it also allows some logged events to appear to be “transactional”, occurring at the same moment.

This implementation borrows a shared (but thread-local) buffer of log events, to ensure that the action only sees one stream of events with increasing timestamps. This may have a cost that we don’t entirely understand.

Source

pub fn flush(&self)

Flushes logged messages and communicates the new minimal timestamp.

Source

pub fn into_typed<T>(self) -> TypedLogger<CB, T>

Obtain a typed logger.

Trait Implementations

Source§

impl<CB> Clone for Logger<CB>
where CB: ContainerBuilder,

Source§

fn clone(&self) -> Logger<CB>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<CB> Debug for Logger<CB>
where CB: ContainerBuilder + Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more