aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/development.md3
-rw-r--r--src/simtest/bench.rs8
2 files changed, 7 insertions, 4 deletions
diff --git a/docs/development.md b/docs/development.md
index 0640355..442881e 100644
--- a/docs/development.md
+++ b/docs/development.md
@@ -24,7 +24,8 @@ bytes per write by kind, propagation delays, for a full mesh, a writer behind NA
transports, partial meshes of 50 and 100 nodes, lossy links (with delays at random,
and with Mycelium's round trips, each link its own; and Tor's, with some slow circuits), a member away for a while, and
members joining during the writes; several minutes, or one scenario alone
-with `BENCH_SCENARIO`, part of its name: `BENCH_SCENARIO=Tor`; 100 writes per workload
+with `BENCH_SCENARIO`, part of its name: `BENCH_SCENARIO=Tor`; several, comma-separated,
+at once: `BENCH_SCENARIO=Tor,Mycelium`; 100 writes per workload
unless `BENCH_WRITES` says otherwise (more, to see what grows with them); all at once with
`BENCH_PARALLEL=1`, faster on many cores, though sharing them makes delays come out
somewhat higher; and in `bench_bridge`, large values from a writer on a fast transport
diff --git a/src/simtest/bench.rs b/src/simtest/bench.rs
index ac44685..c3996a1 100644
--- a/src/simtest/bench.rs
+++ b/src/simtest/bench.rs
@@ -44,7 +44,8 @@ fn writes() -> usize {
.unwrap_or(WRITES)
}
-/// Only the scenarios whose names contain this, if set: `BENCH_SCENARIO=NAT`.
+/// Only the scenarios whose names contain this, if set: `BENCH_SCENARIO=NAT`; or any of
+/// several, comma-separated, run at once (as `BENCH_PARALLEL`): `BENCH_SCENARIO=Tor,Mycelium`.
const ONLY: &str = "BENCH_SCENARIO";
/// If set, all scenarios at once (`BENCH_PARALLEL=1`): several times faster on many
/// cores, but they share them, so delays (and what depends on timing) may come out
@@ -287,11 +288,12 @@ async fn bench_propagation() {
// Past the test harness's `test … ...`, so each report is on a line of its own.
println!();
let only = std::env::var(ONLY).unwrap_or_default();
+ let parts: Vec<&str> = only.split(',').map(str::trim).collect();
let chosen: Vec<(u64, &'static Scenario)> = (70..)
.zip(SCENARIOS)
- .filter(|(_, scenario)| scenario.name.contains(&only))
+ .filter(|(_, scenario)| parts.iter().any(|part| scenario.name.contains(part)))
.collect();
- if std::env::var_os(PARALLEL).is_some() {
+ if std::env::var_os(PARALLEL).is_some() || parts.len() > 1 {
// All at once, each reported when all are done, in order.
let running: Vec<_> = chosen
.into_iter()