Struct function_timer::FunctionTimer
source · pub struct FunctionTimer { /* private fields */ }
Expand description
Timer.
Implementations§
source§impl FunctionTimer
impl FunctionTimer
sourcepub fn new(metric_name: String, function: String) -> Self
pub fn new(metric_name: String, function: String) -> Self
Create a new FunctionTimer.
Parameters
metric_name
: name of the metric.function
: name of the function that have the annotation. It is used to generate the tagfunction
.
Trait Implementations§
source§impl Drop for FunctionTimer
impl Drop for FunctionTimer
source§fn drop(&mut self)
fn drop(&mut self)
Get execution time and call histogram!
.