pub struct CounterData(/* private fields */);
Expand description
The data retrieved by reading from a Counter
.
Implementations§
Source§impl CounterData
impl CounterData
Sourcepub fn count(&self) -> u64
pub fn count(&self) -> u64
The counter value.
The meaning of this field depends on how the counter was configured when it was built; see [‘Builder’].
Sourcepub fn time_enabled(&self) -> Option<Duration>
pub fn time_enabled(&self) -> Option<Duration>
How long this counter was enabled by the program.
This will be present if ReadFormat::TOTAL_TIME_ENABLED
was
specified in read_format
when the counter was built.
Sourcepub fn time_running(&self) -> Option<Duration>
pub fn time_running(&self) -> Option<Duration>
How long the kernel actually ran this counter.
If time_enabled == time_running
then the counter ran for the entire
period it was enabled, without interruption. Otherwise, the counter
shared the underlying hardware with others and you should adjust its
value accordingly.
This will be present if ReadFormat::TOTAL_TIME_RUNNING
was
specified in read_format
when the counter was built.
Sourcepub fn lost(&self) -> Option<u64>
pub fn lost(&self) -> Option<u64>
The number of lost samples of this event.
This will be present if ReadFormat::LOST
was specified in
read_format
when the counter was built.
Trait Implementations§
Source§impl Clone for CounterData
impl Clone for CounterData
Source§fn clone(&self) -> CounterData
fn clone(&self) -> CounterData
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more