You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I am currently building a framework benchmark tool using rust, and just switched from using wrk to rewrk. Loving it so far as it doesn't has inconsistencies like wrk.
There are some issues with clap when it comes to parsing through another program, for example rust's own std::process::Command utility. I am also submitting a PR to get rid all these issues.
Problem
Here's a demo code that my benchmark program is using (using absolute path just to debug it further)
The exact same arguments seem to work okay with wrk, and any other programs. However, because of this clap issue, rewrk expects us to either specify arguments using t=2threads=2 or t2.
Solution
Threads
// It's trying to parse a `usize` when the value is like ` 3` - with a space, which fails// clap doesn't removes that spacelet threads:usize = match args.value_of("threads").unwrap_or("1").parse()
connections
// Same issue as abovelet conns:usize = match args.value_of("connections").unwrap_or("1").parse()
rounds
// Same issue as abovelet rounds:usize = args .value_of("rounds").unwrap_or("1").parse()
host/url
// again the `uri` fails to parse since it has a space ` http://localhost:3000`let user_input = UserInput::new(bench_type, uri_string).await?;
There's a quick fix - trimming values and that will do it for all the use cases. I'll be submitting a PR that fixes all these.
The text was updated successfully, but these errors were encountered:
Hi, I am currently building a framework benchmark tool using rust, and just switched from using wrk to rewrk. Loving it so far as it doesn't has inconsistencies like wrk.
There are some issues with clap when it comes to parsing through another program, for example rust's own
std::process::Command
utility. I am also submitting a PR to get rid all these issues.Problem
Here's a demo code that my benchmark program is using (using absolute path just to debug it further)
The exact same arguments seem to work okay with wrk, and any other programs. However, because of this clap issue, rewrk expects us to either specify arguments using
t=2
threads=2
ort2
.Solution
Threads
connections
rounds
host/url
There's a quick fix - trimming values and that will do it for all the use cases. I'll be submitting a PR that fixes all these.
The text was updated successfully, but these errors were encountered: