[−][src]Struct game_metrics::Metrics
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]
F: FnMut(&'static str, &Histogram<u64>),
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
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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>,