Skip to main content

BenchmarkClient

Trait BenchmarkClient 

Source
pub trait BenchmarkClient:
    Send
    + Sync
    + 'static {
    // Required methods
    fn chain_id(&self) -> ChainId;
    fn owner<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<AccountOwner, BenchmarkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn commit_operations<'life0, 'async_trait>(
        &'life0 self,
        operations: Vec<Operation>,
    ) -> Pin<Box<dyn Future<Output = Result<(), BenchmarkError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

A client the benchmark can drive, so the same harness runs against either the full ChainClient or a storage-free proposer.

The benchmark loop only ever asks a client to commit one block of operations, which is what makes the two interchangeable: everything else – rate control, block sizing, destination selection, reporting – is the harness’s job and is shared.

Required Methods§

Source

fn chain_id(&self) -> ChainId

The chain this client proposes on.

Source

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

The owner the generated operations are attributed to.

Source

fn commit_operations<'life0, 'async_trait>( &'life0 self, operations: Vec<Operation>, ) -> Pin<Box<dyn Future<Output = Result<(), BenchmarkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Proposes a block carrying operations and returns once it is committed.

Implementations on Foreign Types§

Source§

impl<Env: Environment> BenchmarkClient for ChainClient<Env>

Source§

fn chain_id(&self) -> ChainId

Source§

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

Source§

fn commit_operations<'life0, 'async_trait>( &'life0 self, operations: Vec<Operation>, ) -> Pin<Box<dyn Future<Output = Result<(), BenchmarkError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§