diff --git a/xtask/src/bench/workload.rs b/xtask/src/bench/workload.rs index d82c5ad19..db44b5a8f 100644 --- a/xtask/src/bench/workload.rs +++ b/xtask/src/bench/workload.rs @@ -22,6 +22,8 @@ pub struct Workload { pub run_count: u16, pub extra_cli_args: Vec, pub assets: BTreeMap, + #[serde(default)] + pub precommands: Vec, pub commands: Vec, } @@ -37,6 +39,15 @@ async fn run_commands( let report_folder = &args.report_folder; let workload_name = &workload.name; + for batch in workload + .precommands + .as_slice() + .split_inclusive(|command| !matches!(command.synchronous, SyncMode::DontWait)) + { + super::command::run_batch(meili_client, batch, &workload.assets, &args.asset_folder) + .await?; + } + std::fs::create_dir_all(report_folder) .with_context(|| format!("could not create report directory at {report_folder}"))?;