pub struct SimpleCounter {
name: String,
ctr: Counter<u64>,
shadow: AtomicU64,
}Expand description
Represents a simple monotonic unsigned integer counter.
Fields§
§name: String§ctr: Counter<u64>§shadow: AtomicU64Implementations§
Source§impl SimpleCounter
impl SimpleCounter
Sourcepub fn new(name: &str, description: &str) -> MetricResult<Self>
pub fn new(name: &str, description: &str) -> MetricResult<Self>
Creates a new integer counter with given name and description.
Sourcepub fn increment_by(&self, by: u64)
pub fn increment_by(&self, by: u64)
Increments the counter by the given number.
Auto Trait Implementations§
impl !Freeze for SimpleCounter
impl !RefUnwindSafe for SimpleCounter
impl Send for SimpleCounter
impl Sync for SimpleCounter
impl Unpin for SimpleCounter
impl !UnwindSafe for SimpleCounter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more