pub struct TokioRunner { /* private fields */ }Expand description
Builder for executing workloads with real Tokio implementations.
Implementations§
Source§impl TokioRunner
impl TokioRunner
Sourcepub fn register_workload<S, F, Fut>(self, name: S, workload: F) -> Selfwhere
S: Into<String>,
F: Fn(TokioNetworkProvider, TokioTimeProvider, TokioTaskProvider, WorkloadTopology) -> Fut + 'static,
Fut: Future<Output = SimulationResult<SimulationMetrics>> + 'static,
pub fn register_workload<S, F, Fut>(self, name: S, workload: F) -> Selfwhere
S: Into<String>,
F: Fn(TokioNetworkProvider, TokioTimeProvider, TokioTaskProvider, WorkloadTopology) -> Fut + 'static,
Fut: Future<Output = SimulationResult<SimulationMetrics>> + 'static,
Register a workload with the runner.
§Arguments
name- Name for the workload (for reporting purposes)workload- Async function that takes Tokio providers and topology and returns metrics
Sourcepub async fn run(self) -> TokioReport
pub async fn run(self) -> TokioReport
Run all registered workloads and generate a report.
Trait Implementations§
Source§impl Debug for TokioRunner
impl Debug for TokioRunner
Auto Trait Implementations§
impl Freeze for TokioRunner
impl !RefUnwindSafe for TokioRunner
impl !Send for TokioRunner
impl !Sync for TokioRunner
impl Unpin for TokioRunner
impl !UnwindSafe for TokioRunner
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more