[][src]Struct game_metrics::Metrics

pub struct Metrics { /* fields omitted */ }

The metrics struct is used to initialize the metrics communications channels and access the Histogram data for each named metric.

Methods

impl Metrics[src]

pub fn for_each_histogram<F>(&self, f: F) where
    F: FnMut(&'static str, &Histogram<u64>), 
[src]

Iterate the histograms created. This function accepts a closure of FnMut(&'static str, &Histogram<u64>) taking the span name and the histogram as arguments.

pub fn flush(&self)[src]

Blocks the current thread until the worker thread has completed flushing the receiver.

Warning

In high contention situations, this may block indefinitely. This method is meant to be used in the context of a game engine, where execution can be guaranteed to be blocked for metric collection.

pub fn new(sigfig: u8) -> Metrics[src]

Creates a new metrcs instance, initializing metrics and spawning a worker to collect the data.

Warning

Any given instance of Metrics will globally collect a duplicate of the Histgram data. Only one instance should be active at a time.

Trait Implementations

impl Drop for Metrics[src]

Auto Trait Implementations

impl !RefUnwindSafe for Metrics

impl Send for Metrics

impl Sync for Metrics

impl Unpin for Metrics

impl !UnwindSafe for Metrics

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, 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.