Skip to content

Commit

Permalink
allow 0 value for warmup
Browse files Browse the repository at this point in the history
  • Loading branch information
zekroTJA committed Mar 18, 2024
1 parent 7b34a46 commit feb9f74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rush"
version = "0.5.0"
version = "0.5.1"
edition = "2021"
authors = ["Ringo Hoffmann <contact@zekro.de>"]
description = "A tiny HTTP benchmarking and performance testing CLI tool."
Expand Down
6 changes: 4 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ struct Args {

/// Perform warmup requests which do not count to the benchmark result
#[arg(short, long)]
warmup: Option<NonZeroU32>,
warmup: Option<u32>,

/// A duration awaited before a request is sent; you can pass
/// a range (format: 'from..to', e.g. '10ms..20ms') from which
Expand Down Expand Up @@ -113,7 +113,9 @@ fn main() -> Result<()> {
.build()?;

if let Some(warmup) = args.warmup {
perform_requests(&pool, &client, warmup.into(), wait.as_ref())?;
if warmup > 0 {
perform_requests(&pool, &client, warmup, wait.as_ref())?;
}
}

let mut res = perform_requests(&pool, &client, args.count.into(), wait.as_ref())?;
Expand Down

0 comments on commit feb9f74

Please sign in to comment.