-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Stats in json to stdout (new command line option --json) #2269
Stats in json to stdout (new command line option --json) #2269
Conversation
Nice! I think it makes more sense to send the output directly to stdout using print() instead of using logging. That removes the need to disable logging too. Can you also add a test case? (either an integration test in test_main.py, or in test_stats.py or whatever it is called) |
I think the user explicitly specifying |
30b6222
to
a70b3b5
Compare
I've made some integration tests, and deleted the part about skipping logging. Merry Christmas 🎄 |
Cool stuff, thanks! |
@cyberw @AndersSpringborg out of curiosity, why not matching ENV_VAR for this option? Any particular reason? Would a pr to add that be welcome? |
I extended the cli with a
--json
argument. This argument prints the result of a run in json, after a run is finished. It blocks other INFO logs, so it's easy to interoperable with other programs. Below is an example withjq
Locust: 2.13.2.dev11
Python: 3.10.8