Struct jemalloc_ctl::Epoch
[−]
[src]
pub struct Epoch(_);
A type providing access to the jemalloc epoch.
Many of the statistics tracked by jemalloc are cached. The epoch controls when they are refreshed.
Example
Advancing the epoch:
use jemalloc_ctl::Epoch; let epoch = Epoch::new().unwrap(); let a = epoch.advance().unwrap(); let b = epoch.advance().unwrap(); assert_eq!(a + 1, b);
Methods
impl Epoch
[src]
pub fn new() -> Result<Epoch>
[src]
Returns a new Epoch
.
pub fn advance(&self) -> Result<u64>
[src]
Advances the epoch, returning it.
The epoch advances by 1 every time it is advanced, so the value can be used to determine if another thread triggered a referesh.