Struct conserve::report::Report
[−]
[src]
pub struct Report { /* fields omitted */ }
A Report is notified of problems or non-problematic events that occur while Conserve is running.
A Report holds counters, identified by a name. The name must be in KNOWN_COUNTERS
.
A Report is internally mutable, so a single instance can be shared by multiple objects or scopes (on the same thread) who all append to it.
Cloning a Report makes a shared reference to the same underlying counters.
Methods
impl Report
[src]
fn new() -> Report
[src]
Default constructor with plain text UI.
fn with_ui(ui_box: Box<UI + Send>) -> Report
[src]
Make a new report viewed by a given UI.
fn borrow_counts(&self) -> MutexGuard<Counts>
[src]
Borrow (read-only) counters inside this report.
fn increment(&self, counter_name: &'static str, delta: u64)
[src]
Increment a counter by a given amount.
The name must be a static string. Counters implicitly start at 0.
fn increment_size(&self, counter_name: &str, sizes: Sizes)
[src]
fn increment_duration(&self, name: &str, duration: Duration)
[src]
fn merge_from(&self, from_report: &Report)
[src]
Merge the contents of from_report
into self
.
fn measure_duration<T, F>(&self, duration_name: &str, closure: F) -> T where
F: FnOnce() -> T,
[src]
F: FnOnce() -> T,
fn become_logger(&self, log_level: LogLevelFilter)
[src]
fn get_size(&self, counter_name: &str) -> Sizes
[src]
fn get_count(&self, counter_name: &str) -> u64
[src]
fn get_duration(&self, name: &str) -> Duration
[src]
Trait Implementations
impl Clone for Report
[src]
fn clone(&self) -> Report
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Report
[src]
impl Display for Report
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
Formats the value using the given formatter. Read more