Struct opentelemetry::sdk::metrics::Accumulator
source · pub struct Accumulator(_);
Available on crate feature
metrics
only.Expand description
Accumulator implements the OpenTelemetry Meter API. The Accumulator is bound
to a single Processor
.
The Accumulator supports a collect API to gather and export current data.
Collect
should be arranged according to the processor model. Push-based
processors will setup a timer to call collect
periodically. Pull-based
processors will call collect
when a pull request arrives.
Implementations§
source§impl Accumulator
impl Accumulator
sourcepub fn collect(
&self,
cx: &Context,
locked_processor: &mut dyn LockedProcessor
) -> usize
pub fn collect( &self, cx: &Context, locked_processor: &mut dyn LockedProcessor ) -> usize
Traverses the list of active records and observers and exports data for each active instrument.
During the collection pass, the LockedProcessor
will receive
one export
call per current aggregation.
Returns the number of records that were checkpointed.
Trait Implementations§
source§impl Clone for Accumulator
impl Clone for Accumulator
source§fn clone(&self) -> Accumulator
fn clone(&self) -> Accumulator
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Accumulator
impl Debug for Accumulator
source§impl MeterCore for Accumulator
impl MeterCore for Accumulator
source§fn new_sync_instrument(
&self,
descriptor: Descriptor
) -> Result<Arc<dyn SyncInstrumentCore + Sync + Send + 'static>, MetricsError>
fn new_sync_instrument( &self, descriptor: Descriptor ) -> Result<Arc<dyn SyncInstrumentCore + Sync + Send + 'static>, MetricsError>
Create a new synchronous instrument implementation.
source§fn new_async_instrument(
&self,
descriptor: Descriptor
) -> Result<Arc<dyn AsyncInstrumentCore + Sync + Send + 'static>, MetricsError>
fn new_async_instrument( &self, descriptor: Descriptor ) -> Result<Arc<dyn AsyncInstrumentCore + Sync + Send + 'static>, MetricsError>
Create a new asynchronous instrument implementation. Read more