Skip to content

Commit 6e2448d

Browse files
committed
Allow benchmarking and profiling stable benchmarks
1 parent 1c32479 commit 6e2448d

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

collector/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ The following options alter the behaviour of the `bench_local` subcommand.
135135
comma-separated list of benchmark prefixes. When this option is specified, a
136136
benchmark is included in the run only if its name matches one of the given
137137
prefixes.
138+
- `--category <CATEGORIES>`: benchmark categories that should be included. The
139+
possible choices are one or more (comma-separated) of `primary`, `secondary`,
140+
`stable`, and `All`. The default is `primary,secondary`.
138141
- `--profiles <PROFILES>`: the profiles to be benchmarked. The possible choices
139142
are one or more (comma-separated) of `Check`, `Debug`, `Doc`, `Opt`, and
140143
`All`. The default is `Check,Debug,Opt`.

collector/src/bin/collector.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,10 @@ struct LocalOptions {
322322
/// Include only benchmarks matching a prefix in this comma-separated list
323323
#[arg(long)]
324324
include: Option<String>,
325+
326+
/// Include only benchmarks belonging to the given categories.
327+
#[arg(long, value_parser = EnumArgParser::<Category>::default(), default_value = "primary,secondary")]
328+
category: MultiEnumValue<Category>,
325329
}
326330

327331
#[derive(Debug, clap::Args)]
@@ -909,7 +913,7 @@ fn main_result() -> anyhow::Result<i32> {
909913
local.exclude.as_deref(),
910914
local.exclude_suffix.as_deref(),
911915
)?;
912-
benchmarks.retain(|b| b.category().is_primary_or_secondary());
916+
benchmarks.retain(|b| local.category.0.contains(&b.category()));
913917

914918
let artifact_id = ArtifactId::Tag(toolchain.id.clone());
915919
let mut conn = rt.block_on(pool.connection());
@@ -1082,7 +1086,7 @@ fn main_result() -> anyhow::Result<i32> {
10821086
local.exclude.as_deref(),
10831087
local.exclude_suffix.as_deref(),
10841088
)?;
1085-
benchmarks.retain(|b| b.category().is_primary_or_secondary());
1089+
benchmarks.retain(|b| local.category.0.contains(&b.category()));
10861090

10871091
let mut errors = BenchmarkErrors::new();
10881092

0 commit comments

Comments
 (0)