Skip to content

Commit

Permalink
bench: Simplify calls to legacy benchmarks
Browse files Browse the repository at this point in the history
  • Loading branch information
ohsayan committed Apr 29, 2024
1 parent 7ce2aae commit ed09826
Show file tree
Hide file tree
Showing 6 changed files with 349 additions and 341 deletions.
10 changes: 5 additions & 5 deletions sky-bench/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,15 @@ pub enum Task {
}

#[derive(Debug, PartialEq, Clone, Copy)]
pub enum BenchEngine {
pub enum LegacyBenchEngine {
Rookie,
Fury,
}

#[derive(Debug, PartialEq, Clone, Copy)]
pub enum BenchType {
Workload(BenchWorkload),
Legacy(BenchEngine),
Legacy(LegacyBenchEngine),
}

#[derive(Debug, PartialEq, Clone, Copy)]
Expand Down Expand Up @@ -197,8 +197,8 @@ pub fn parse_and_setup() -> BenchResult<Task> {
BenchType::Workload(BenchWorkload::UniformV1)
}
Some(engine) => BenchType::Legacy(match engine.as_str() {
"rookie" => BenchEngine::Rookie,
"fury" => BenchEngine::Fury,
"rookie" => LegacyBenchEngine::Rookie,
"fury" => LegacyBenchEngine::Fury,
_ => {
return Err(BenchError::ArgsErr(format!(
"bad value for `--engine`. got `{engine}` but expected warp or rookie"
Expand All @@ -211,7 +211,7 @@ pub fn parse_and_setup() -> BenchResult<Task> {
None => num_cpus::get() * 8,
Some(c) => match c.parse::<usize>() {
Ok(s) if s != 0 => {
if workload == BenchType::Legacy(BenchEngine::Rookie) {
if workload == BenchType::Legacy(LegacyBenchEngine::Rookie) {
return Err(BenchError::ArgsErr(format!(
"the 'rookie' engine does not support explicit connection count. the number of threads is the connection count"
)));
Expand Down

0 comments on commit ed09826

Please sign in to comment.