Skip to content

Commit e94b7ad

Browse files
ci: add input to benchmark config
1 parent 5eeea45 commit e94b7ad

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

crates/bench_tools/src/types/benchmark_config.rs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,21 @@ pub struct BenchmarkConfig {
44
pub name: &'static str,
55
pub package: &'static str,
66
pub cmd_args: &'static [&'static str],
7+
/// Optional input directory path relative to workspace root. If set, inputs will be
8+
/// downloaded from GCS before running the benchmark.
9+
pub input_dir: Option<&'static str>,
710
}
811

912
impl BenchmarkConfig {
1013
/// Get the full cargo bench command as owned strings.
1114
pub fn cmd_args_owned(&self) -> Vec<String> {
1215
self.cmd_args.iter().map(|s| s.to_string()).collect()
1316
}
17+
18+
/// Check if this benchmark requires input files.
19+
pub fn needs_inputs(&self) -> bool {
20+
self.input_dir.is_some()
21+
}
1422
}
1523

1624
/// All available benchmarks defined as a const array.
@@ -19,16 +27,25 @@ pub const BENCHMARKS: &[BenchmarkConfig] = &[
1927
name: "full_committer_flow",
2028
package: "starknet_committer_and_os_cli",
2129
cmd_args: &["bench", "-p", "starknet_committer_and_os_cli", "full_committer_flow"],
30+
input_dir: Some("crates/starknet_committer_and_os_cli/test_inputs"),
2231
},
2332
BenchmarkConfig {
2433
name: "single_tree_flow",
2534
package: "starknet_committer_and_os_cli",
2635
cmd_args: &["bench", "-p", "starknet_committer_and_os_cli", "single_tree_flow"],
36+
input_dir: Some("crates/starknet_committer_and_os_cli/test_inputs"),
2737
},
2838
BenchmarkConfig {
2939
name: "gateway_apply_block",
3040
package: "apollo_gateway",
3141
cmd_args: &["bench", "-p", "apollo_gateway", "apply_block"],
42+
input_dir: None,
43+
},
44+
BenchmarkConfig {
45+
name: "dummy_benchmark",
46+
package: "bench_tools",
47+
cmd_args: &["bench", "-p", "bench_tools", "--bench", "dummy_bench"],
48+
input_dir: Some("crates/bench_tools/data/dummy_bench_input"),
3249
},
3350
];
3451

0 commit comments

Comments
 (0)