[−][src]Trait tracing_timing::EventGroup
Translate attributes from a tracing event into a timing event group.
All events that share a SpanGroup
, and whose attributes produce the same Id
-typed value
when passed through group
, are considered a single timing target, and have their samples
recorded together.
This trait is implemented for all functions with the appropriate signature. Note that you may
run into weird lifetime errors from the compiler when using a closure as an EventGroup
. This
is a known compiler issue. You can work around it by adding a slight type hint to the
arguments passed to the closure as follows (note the : &_
):
use tracing_timing::{Builder, Histogram}; use tracing::Event; let s = Builder::default() .events(|_: &Event| "all events as one") .build(|| Histogram::new(3).unwrap());
Associated Types
type Id
The type of the timing event group.
Required methods
Loading content...Implementors
impl EventGroup for ByField
[src]
impl EventGroup for ByMessage
[src]
impl EventGroup for ByName
[src]
impl EventGroup for ByTarget
[src]
impl<F, R> EventGroup for F where
F: Fn(&Event) -> R,
[src]
F: Fn(&Event) -> R,