Skip to content

Commit

Permalink
Merge pull request #447 from kyrias/fix-size-per-request-printing
Browse files Browse the repository at this point in the history
Fix printing of Size/request
  • Loading branch information
hatoo authored Apr 2, 2024
2 parents 06306fe + 2b2f404 commit d617411
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/printer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -396,15 +396,13 @@ fn print_summary<W: Write>(
" Total data:\t{:.2}",
Byte::from_u64(calculate_total_data(res)).get_appropriate_unit(byte_unit::UnitType::Binary)
)?;
writeln!(
w,
" Size/request:\t{:.2}",
(calculate_size_per_request(res))
.map(|n| Byte::from_u64(n)
.get_appropriate_unit(byte_unit::UnitType::Binary)
.to_string())
.unwrap_or_else(|| "NaN".to_string())
)?;
if let Some(size) = calculate_size_per_request(res)
.map(|n| Byte::from_u64(n).get_appropriate_unit(byte_unit::UnitType::Binary))
{
writeln!(w, " Size/request:\t{size:.2}")?;
} else {
writeln!(w, " Size/request:\tNaN")?;
}
writeln!(
w,
" Size/sec:\t{:.2}",
Expand Down

0 comments on commit d617411

Please sign in to comment.