-
-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature burst #278
Feature burst #278
Conversation
Thank you! I really appreciate it. Since I'm busy now, I'll review it sometime this week. But at a glance,
|
No worries :) Regarding your input: README.mdSure thing! Test suiteI'm not sure how I would test assertion with work_* functions either, as it doesn't return any thing. If you can point out what you would like me to test, I would be happy to do it. Burst argumentsI tried to implement the argument the way you wanted it, but I couldn't find a way for it to parse in the struct: Maybe you can give me some guidance. First, I used
But when I build this, I tested it out with which states:
Now looking out for the derive version of this. I should be able to just do #[group()]. But I couldn't: I thought it was due to the fact that it's missing some dependencies. So I checked Noticed that it's dependent on the
But it failed when I specified both of the arguments. So I finally sorted it out to the way it's currently now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! I leave some reviews
Argment parse
Sure, I've realized it's a current clap
's limitation. The implementation is OK for now.
clap-rs/clap#1717
test
Tests are done by starting a test HTTP server and running the command itself using assert_cmd
and checking the server's log.
https://github.com/hatoo/oha/blob/master/tests/tests.rs
The tests I want are e.g.
- run
oha -n 10 --burst-rate 7 ...
and check exactly 10 requests are sent
…t, added it in .gitignore, and added description in README
I reviewed and fixed up the comments you made, and also added tests and documentation in README :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great!
I left some nit reviews
note: The CI failure is OK. It seems like a Clippy's bug.
Coolio! All fixed :) |
Merged, Thanks! 👍 |
No worries! Thanks for that |
#276 Introducing
burst
:Using
--burst-duration
: the user can now add a delay between requests. For example: If-n 10 --burst-duration 2s
, oha will run one request every 2s until it reaches 10sAdding along with
--burst-requests
: the rate of requests at one point in time the user wants to send. E.g: In the example above-n 10 --burst-duration 2s --burst-requests 2
, oha will now run 2 requests every 2sChanges to the code: