Skip to content

Commit

Permalink
feature: benchmark-analyzer accepts max group size (#10)
Browse files Browse the repository at this point in the history
Co-authored-by: Igor Zhirkov <[email protected]>
  • Loading branch information
sayon and Igor Zhirkov authored Apr 11, 2024
1 parent f867c80 commit d0d2562
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 4 additions & 0 deletions benchmark_analyzer/src/benchmark_analyzer/arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ pub struct Arguments {
/// The output file. If unset, the result is printed to `stdout`.
#[structopt(short = "o", long = "output-file")]
pub output_path: Option<PathBuf>,

/// Maximum number of results displayed in a group.
#[structopt(short = "gm", long = "group-max", default_value = "100")]
pub group_max: usize,
}

impl Arguments {
Expand Down
4 changes: 2 additions & 2 deletions benchmark_analyzer/src/benchmark_analyzer/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fn main() -> anyhow::Result<()> {
let mut file = std::fs::File::create(output_path)?;
for (group_name, mut results) in groups_results.into_iter() {
results.sort_worst();
results.print_worst_results(100, group_name);
results.print_worst_results(arguments.group_max, group_name);
results.write_all(&mut file, group_name)?;
writeln!(file)?;
println!();
Expand All @@ -35,7 +35,7 @@ fn main() -> anyhow::Result<()> {
let mut stdout = std::io::stdout();
for (group_name, mut results) in groups_results.into_iter() {
results.sort_worst();
results.print_worst_results(100, group_name);
results.print_worst_results(arguments.group_max, group_name);
results.write_all(&mut stdout, group_name)?;
writeln!(stdout)?;
println!();
Expand Down

0 comments on commit d0d2562

Please sign in to comment.