profile mode (#5617)

This commit is contained in:
Nikolay Volf
2020-04-13 11:08:14 -07:00
committed by GitHub
parent 76a5555031
commit b2b5717d6b
3 changed files with 40 additions and 7 deletions
+11 -2
View File
@@ -17,7 +17,7 @@
#[macro_use] mod core;
mod import;
use crate::core::run_benchmark;
use crate::core::{run_benchmark, Mode as BenchmarkMode};
use import::{ImportBenchmarkDescription, SizeType};
use node_testing::bench::{Profile, KeyTypes};
use structopt::StructOpt;
@@ -41,6 +41,15 @@ struct Opt {
///
/// Run with `--list` for the hint of what to filter.
filter: Option<String>,
/// Mode
///
/// "regular" for regular becnhmark
///
/// "profile" mode adds pauses between measurable runs,
/// so that actual interval can be selected in the profiler of choice.
#[structopt(short, long, default_value = "regular")]
mode: BenchmarkMode,
}
fn main() {
@@ -81,7 +90,7 @@ fn main() {
for benchmark in benchmarks {
if opt.filter.as_ref().map(|f| benchmark.path().has(f)).unwrap_or(true) {
log::info!("Starting {}", benchmark.name());
let result = run_benchmark(benchmark);
let result = run_benchmark(benchmark, opt.mode);
log::info!("{}", result);
results.push(result);