pub struct SumAggregator { /* private fields */ }
Available on crate feature
metrics
only.Expand description
An aggregator for counter events.
Trait Implementations§
Source§impl Aggregator for SumAggregator
impl Aggregator for SumAggregator
Source§fn update(&self, number: &Number, descriptor: &Descriptor) -> Result<()>
fn update(&self, number: &Number, descriptor: &Descriptor) -> Result<()>
Update receives a new measured value and incorporates it into the
aggregation. Update calls may be called concurrently. Read more
Source§fn synchronized_move(
&self,
other: &Arc<dyn Aggregator + Send + Sync>,
descriptor: &Descriptor,
) -> Result<()>
fn synchronized_move( &self, other: &Arc<dyn Aggregator + Send + Sync>, descriptor: &Descriptor, ) -> Result<()>
This method is called during collection to finish one period of aggregation
by atomically saving the currently-updating state into the argument
Aggregator. Read more
Source§fn merge(
&self,
other: &(dyn Aggregator + Send + Sync),
descriptor: &Descriptor,
) -> Result<()>
fn merge( &self, other: &(dyn Aggregator + Send + Sync), descriptor: &Descriptor, ) -> Result<()>
This combines the checkpointed state from the argument
Aggregator
into this
Aggregator
. merge
is not synchronized with respect to update
or
synchronized_move
. Read moreSource§impl Debug for SumAggregator
impl Debug for SumAggregator
Source§impl Default for SumAggregator
impl Default for SumAggregator
Source§fn default() -> SumAggregator
fn default() -> SumAggregator
Returns the “default value” for a type. Read more
Source§impl Subtractor for SumAggregator
impl Subtractor for SumAggregator
Source§fn subtract(
&self,
operand: &(dyn Aggregator + Send + Sync),
result: &(dyn Aggregator + Send + Sync),
descriptor: &Descriptor,
) -> Result<()>
fn subtract( &self, operand: &(dyn Aggregator + Send + Sync), result: &(dyn Aggregator + Send + Sync), descriptor: &Descriptor, ) -> Result<()>
Subtract subtracts the
operand
from this Aggregator and outputs the value
in result
.Auto Trait Implementations§
impl !Freeze for SumAggregator
impl RefUnwindSafe for SumAggregator
impl Send for SumAggregator
impl Sync for SumAggregator
impl Unpin for SumAggregator
impl UnwindSafe for SumAggregator
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
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Available on crate feature
trace
only.Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Available on crate feature
trace
only.