pub struct BillingPipeline<E> { /* private fields */ }Expand description
Coordinates a UsageBuffer with an off-path exporter.
Implementations§
Source§impl<E> BillingPipeline<E>
impl<E> BillingPipeline<E>
Sourcepub fn new(exporter: E) -> BillingPipeline<E>
pub fn new(exporter: E) -> BillingPipeline<E>
Construct a pipeline with the default bounded deduplication store.
Sourcepub fn with_idempotency_capacity(
exporter: E,
capacity: usize,
) -> BillingPipeline<E>
pub fn with_idempotency_capacity( exporter: E, capacity: usize, ) -> BillingPipeline<E>
Construct a pipeline with an explicit idempotency-key bound.
Sourcepub fn pending_buckets(&self) -> usize
pub fn pending_buckets(&self) -> usize
Number of buffered aggregate buckets.
Sourcepub fn retry_buckets(&self) -> usize
pub fn retry_buckets(&self) -> usize
Number of aggregates waiting to be retried.
Worth alerting on: a count that never falls is usage the provider keeps refusing, and the buffer is in memory, so it is lost at the next deploy.
Source§impl<E> BillingPipeline<E>where
E: BatchExporter,
impl<E> BillingPipeline<E>where
E: BatchExporter,
Sourcepub async fn flush(&self) -> Result<usize, ExportError>
pub async fn flush(&self) -> Result<usize, ExportError>
Drain and export one batch. Failed batches retain their exact identifiers for an idempotent retry.
§Errors
Returns ExportError::FlushInProgress for overlapping flushes, or the
provider error after restoring the batch for retry.
Trait Implementations§
Source§impl<E> Debug for BillingPipeline<E>
impl<E> Debug for BillingPipeline<E>
Source§impl<E> UsageRecorder for BillingPipeline<E>where
E: BatchExporter,
impl<E> UsageRecorder for BillingPipeline<E>where
E: BatchExporter,
Source§fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>
fn record(&self, event: UsageEvent) -> Result<RecordOutcome, RecordError>
Add one event without performing I/O. Read more
Auto Trait Implementations§
impl<E> !Freeze for BillingPipeline<E>
impl<E> RefUnwindSafe for BillingPipeline<E>where
E: RefUnwindSafe,
impl<E> Send for BillingPipeline<E>where
E: Send,
impl<E> Sync for BillingPipeline<E>where
E: Sync,
impl<E> Unpin for BillingPipeline<E>where
E: Unpin,
impl<E> UnsafeUnpin for BillingPipeline<E>where
E: UnsafeUnpin,
impl<E> UnwindSafe for BillingPipeline<E>where
E: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more