Struct libreda_db::profile::PerfCounter
source · pub struct PerfCounter {
num_calls: AtomicU64,
total_time_ns: AtomicU64,
min_time_ns: AtomicU64,
max_time_ns: AtomicU64,
}Expand description
Atomic counters for recording statistics on calls of a single function.
Fields§
§num_calls: AtomicU64Number of function calls.
total_time_ns: AtomicU64Total time spent in this function.
min_time_ns: AtomicU64Shortest measured duration spend in this function.
max_time_ns: AtomicU64Longest measured duration spend in this function.
Implementations§
source§impl PerfCounter
impl PerfCounter
sourcepub fn atomic_read(&self) -> PerfCounterResult
pub fn atomic_read(&self) -> PerfCounterResult
Atomically read the current state of the counter.
source§impl PerfCounter
impl PerfCounter
sourcefn start_measurement(&self) -> PerfCounterManager<'_>
fn start_measurement(&self) -> PerfCounterManager<'_>
Start measuring the spent time.
Must call stop() on the return value.