Skip to content

Commit

Permalink
Perf Test Resiliency (#945)
Browse files Browse the repository at this point in the history
* Provide CLI arg to bypass perf-test sysinfo query

* Don't use the shortcut for default-value

* Compiler won't allow default-value for boolean anyway

* cargo fmt
  • Loading branch information
notlesh authored Nov 8, 2021
1 parent 98d6c2f commit c4ad942
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
21 changes: 13 additions & 8 deletions node/perf-test/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,18 +467,23 @@ impl PerfCmd {
all_test_results.append(&mut results);
}

let system_info = query_system_info()?;
let partition_info = query_partition_info(path).unwrap_or_else(|_| {
// TODO: this is inconsistent with behavior of query_system_info...
eprintln!("query_partition_info() failed, ignoring...");
Default::default()
});
let (system_info, partition_info) = if cmd.disable_sysinfo {
(None, None)
} else {
let sys = query_system_info()?;
let part = query_partition_info(path).unwrap_or_else(|_| {
// TODO: this is inconsistent with behavior of query_system_info...
eprintln!("query_partition_info() failed, ignoring...");
Default::default()
});
(Some(sys), Some(part))
};

#[derive(Serialize)]
struct AllResults {
test_results: Vec<TestResults>,
system_info: SystemInfo,
partition_info: PartitionInfo,
system_info: Option<SystemInfo>,
partition_info: Option<PartitionInfo>,
}

let all_results = AllResults {
Expand Down
6 changes: 6 additions & 0 deletions node/perf-test/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,12 @@ pub struct PerfCmd {
)]
pub output_file: Option<PathBuf>,

#[structopt(
long = "disable-sysinfo",
help = "Do not attempt to query system info."
)]
pub disable_sysinfo: bool,

// TODO: allow multiple tests (like the -l switch for logging)
#[structopt(
long = "tests",
Expand Down

0 comments on commit c4ad942

Please sign in to comment.