pub struct MetricBuffer { /* private fields */ }
Implementations§
Source§impl MetricBuffer
impl MetricBuffer
pub fn new() -> Self
Sourcepub async fn add_metric(
&self,
local_elem_id: LocalElementId,
metric_code: String,
value: MetricValue,
)
pub async fn add_metric( &self, local_elem_id: LocalElementId, metric_code: String, value: MetricValue, )
Adds a metric to the buffer.
Sourcepub async fn get_and_clear(
&self,
) -> HashMap<LocalElementId, HashMap<String, MetricValue>>
pub async fn get_and_clear( &self, ) -> HashMap<LocalElementId, HashMap<String, MetricValue>>
Retrieves and clears all buffered metrics.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for MetricBuffer
impl !RefUnwindSafe for MetricBuffer
impl Send for MetricBuffer
impl Sync for MetricBuffer
impl Unpin for MetricBuffer
impl !UnwindSafe for MetricBuffer
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