Skip to main content

StatisticsPort

Trait StatisticsPort 

Source
pub trait StatisticsPort: Send + Sync {
    // Required methods
    fn record_deliberation<'life0, 'life1, 'async_trait>(
        &'life0 self,
        specialty: &'life1 Specialty,
        duration: DurationMs,
    ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn record_orchestration<'life0, 'async_trait>(
        &'life0 self,
        duration: DurationMs,
    ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn snapshot<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Statistics, DomainError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn record_deliberation<'life0, 'life1, 'async_trait>( &'life0 self, specialty: &'life1 Specialty, duration: DurationMs, ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Record that a deliberation for specialty completed in duration.

Source

fn record_orchestration<'life0, 'async_trait>( &'life0 self, duration: DurationMs, ) -> Pin<Box<dyn Future<Output = Result<(), DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Record that an orchestration (deliberate + execute) completed in duration.

Source

fn snapshot<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<Statistics, DomainError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Read-only snapshot. Callers receive a clone so the returned value is safe to serialise without holding any lock.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§