pub struct TokenCounter(/* private fields */);👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Expand description
A helper that sends the count of created tokens as a datapoint.
Implementations§
Source§impl TokenCounter
impl TokenCounter
Sourcepub fn new(name: &'static str) -> Self
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn new(name: &'static str) -> Self
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Creates a new counter with the specified metrics name.
Sourcepub fn create_token(&self) -> CounterToken
👎Deprecated since 3.1.0: This crate has been marked for formal inclusion in the Agave Unstable API. From v4.0.0 onward, the agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.
pub fn create_token(&self) -> CounterToken
agave-unstable-api crate feature must be specified to acknowledge use of an interface that may break without warning.Creates a new token for this counter. The metric’s value will be equal
to the number of CounterTokens.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TokenCounter
impl RefUnwindSafe for TokenCounter
impl Send for TokenCounter
impl Sync for TokenCounter
impl Unpin for TokenCounter
impl UnwindSafe for TokenCounter
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