-
Notifications
You must be signed in to change notification settings - Fork 313
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
Allow to pass parameters via a file #441
Allow to pass parameters via a file #441
Conversation
Previously we allowed users to pass track, car and plugin parameters via a list of key-value pairs. While this covers a lot of use cases, we can give users even more flexibility by letting them provide a file to Rally. This allows users to pass also nested structures which is e.g. handy to specify index settings.
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.
Useful addition, thanks!
I left a minor question.
esrally/rally.py
Outdated
@@ -587,6 +587,15 @@ def dispatch_sub_command(cfg, sub_command): | |||
return False | |||
|
|||
|
|||
def to_dict(arg): | |||
if io.has_extension(arg, ".json"): | |||
import json |
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.
Minor comment: you probably have your reasons, but why not have this at the top? AFAIK pep8 is rather strict about this. I read some literature preferring from json import load
for inside-function uses such as this one, if it must be done.
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.
I wanted to limit the scope of the import so we don't accidentally use this functionality somewhere else. I'm fine with putting it at the top. Mid-term it might make sense to split rally.py
though.
Previously we allowed users to pass track, car and plugin parameters via
a list of key-value pairs. While this covers a lot of use cases, we can
give users even more flexibility by letting them provide a file to
Rally. This allows users to pass also nested structures which is e.g.
handy to specify index settings.