Skip to content

Commit c492914

Browse files
committed
Rename BenchmarkFilter to RuntimeBenchmarkFilter
1 parent 8158f78 commit c492914

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

collector/src/bin/collector.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@ use collector::compile::execute::bencher::BenchProcessor;
4545
use collector::compile::execute::profiler::{ProfileProcessor, Profiler};
4646
use collector::runtime::{
4747
bench_runtime, get_runtime_benchmark_groups, prepare_runtime_benchmark_suite,
48-
runtime_benchmark_dir, BenchmarkFilter, BenchmarkSuite, BenchmarkSuiteCompilation,
49-
CargoIsolationMode, RuntimeProfiler, DEFAULT_RUNTIME_ITERATIONS,
48+
runtime_benchmark_dir, BenchmarkSuite, BenchmarkSuiteCompilation, CargoIsolationMode,
49+
RuntimeBenchmarkFilter, RuntimeProfiler, DEFAULT_RUNTIME_ITERATIONS,
5050
};
5151
use collector::runtime::{profile_runtime, RuntimeCompilationOpts};
5252
use collector::toolchain::{
@@ -105,12 +105,12 @@ struct CompileBenchmarkConfig {
105105

106106
struct RuntimeBenchmarkConfig {
107107
runtime_suite: BenchmarkSuite,
108-
filter: BenchmarkFilter,
108+
filter: RuntimeBenchmarkFilter,
109109
iterations: u32,
110110
}
111111

112112
impl RuntimeBenchmarkConfig {
113-
fn new(suite: BenchmarkSuite, filter: BenchmarkFilter, iterations: u32) -> Self {
113+
fn new(suite: BenchmarkSuite, filter: RuntimeBenchmarkFilter, iterations: u32) -> Self {
114114
Self {
115115
runtime_suite: suite.filter(&filter),
116116
filter,
@@ -761,7 +761,7 @@ fn main_result() -> anyhow::Result<i32> {
761761
};
762762
let config = RuntimeBenchmarkConfig::new(
763763
runtime_suite,
764-
BenchmarkFilter::new(local.exclude, local.include),
764+
RuntimeBenchmarkFilter::new(local.exclude, local.include),
765765
iterations,
766766
);
767767
run_benchmarks(&mut rt, conn, shared, None, Some(config))?;
@@ -1042,7 +1042,7 @@ fn main_result() -> anyhow::Result<i32> {
10421042

10431043
let runtime_config = RuntimeBenchmarkConfig {
10441044
runtime_suite,
1045-
filter: BenchmarkFilter::keep_all(),
1045+
filter: RuntimeBenchmarkFilter::keep_all(),
10461046
iterations: DEFAULT_RUNTIME_ITERATIONS,
10471047
};
10481048
let shared = SharedBenchmarkConfig {
@@ -1745,7 +1745,7 @@ fn bench_published_artifact(
17451745
}),
17461746
Some(RuntimeBenchmarkConfig::new(
17471747
runtime_suite,
1748-
BenchmarkFilter::keep_all(),
1748+
RuntimeBenchmarkFilter::keep_all(),
17491749
DEFAULT_RUNTIME_ITERATIONS,
17501750
)),
17511751
)

collector/src/runtime/benchmark.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub struct BenchmarkSuite {
4242
impl BenchmarkSuite {
4343
/// Returns a new suite containing only groups that contains at least a single benchmark
4444
/// that matches the filter.
45-
pub fn filter(self, filter: &BenchmarkFilter) -> Self {
45+
pub fn filter(self, filter: &RuntimeBenchmarkFilter) -> Self {
4646
let BenchmarkSuite {
4747
toolchain,
4848
groups,
@@ -64,7 +64,7 @@ impl BenchmarkSuite {
6464
}
6565
}
6666

67-
pub fn filtered_benchmark_count(&self, filter: &BenchmarkFilter) -> u64 {
67+
pub fn filtered_benchmark_count(&self, filter: &RuntimeBenchmarkFilter) -> u64 {
6868
self.benchmark_names()
6969
.filter(|benchmark| passes_filter(benchmark, &filter.exclude, &filter.include))
7070
.count() as u64
@@ -86,12 +86,12 @@ impl BenchmarkSuite {
8686
}
8787
}
8888

89-
pub struct BenchmarkFilter {
89+
pub struct RuntimeBenchmarkFilter {
9090
pub exclude: Vec<String>,
9191
pub include: Vec<String>,
9292
}
9393

94-
impl BenchmarkFilter {
94+
impl RuntimeBenchmarkFilter {
9595
pub fn keep_all() -> Self {
9696
Self {
9797
exclude: vec![],

collector/src/runtime/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ use thousands::Separable;
99
use benchlib::comm::messages::{BenchmarkMessage, BenchmarkResult, BenchmarkStats};
1010
pub use benchmark::{
1111
get_runtime_benchmark_groups, prepare_runtime_benchmark_suite, runtime_benchmark_dir,
12-
BenchmarkFilter, BenchmarkGroup, BenchmarkGroupCrate, BenchmarkSuite,
13-
BenchmarkSuiteCompilation, CargoIsolationMode,
12+
BenchmarkGroup, BenchmarkGroupCrate, BenchmarkSuite, BenchmarkSuiteCompilation,
13+
CargoIsolationMode, RuntimeBenchmarkFilter,
1414
};
1515
use database::{ArtifactIdNumber, CollectionId, Connection};
1616

@@ -33,7 +33,7 @@ pub async fn bench_runtime(
3333
conn: &mut dyn Connection,
3434
suite: BenchmarkSuite,
3535
collector: &CollectorCtx,
36-
filter: BenchmarkFilter,
36+
filter: RuntimeBenchmarkFilter,
3737
iterations: u32,
3838
) -> anyhow::Result<()> {
3939
let filtered = suite.filtered_benchmark_count(&filter);
@@ -203,7 +203,7 @@ async fn record_stats(
203203
/// a set of runtime benchmarks and print `BenchmarkMessage`s encoded as JSON, one per line.
204204
fn execute_runtime_benchmark_binary(
205205
binary: &Path,
206-
filter: &BenchmarkFilter,
206+
filter: &RuntimeBenchmarkFilter,
207207
iterations: u32,
208208
) -> anyhow::Result<impl Iterator<Item = anyhow::Result<BenchmarkMessage>>> {
209209
let mut command = prepare_command(binary);

0 commit comments

Comments
 (0)