-
Notifications
You must be signed in to change notification settings - Fork 314
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
Run a task completely even without time-periods #763
Run a task completely even without time-periods #763
Conversation
There are multiple conditions how a task can be completed. Either the user explicitly specifies a maximum number of iterations or a time-period or a task is implicitly completed when the parameter source is exhausted (e.g. when reading parameters from a file). In the latter case it is not necessary to provide any indication when a task is complete because the parameter source can determine it. However, so far this was required. With this commit we introduce a change in the parameter source API so that it is possible to determine this case and also provide proper progress indication. Furthermore we adapt all parameter sources that come with Rally out of the box and provide guidance for users how to change their own parameter sources.
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.
LGTM thanks! I left a comment about clarifying in the docs how to stop a parameter source with an infinite schedule.
return | ||
if task_progress_control.infinite: | ||
logger.info("Parameter source will determine when the schedule for [%s] terminates.", task_name) | ||
param_source_knows_progress = hasattr(params, "percent_completed") |
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 love the name of this variable 👍
docs/adding_tracks.rst
Outdated
* ``params(self)``: This method returns a dictionary with all parameters that the corresponding "runner" expects. This method will be invoked once for every iteration during the race. In the example, we parameterize the query by randomly selecting a profession from a list. | ||
* ``infinite``: This property helps Rally to determine whether to let the parameter source determine when a task should be finished (usually when ``infinite`` is ``False``) or whether the task properties (e.g. ``iterations`` or ``time-period``) determine when a task should be finished. |
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 think we are missing the crucial information here about how the custom parameter source can trigger a task stop by raising a StopIteration
.
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.
Good catch. I've addressed this in 06add96.
LGTM thanks! |
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.
LGTM
Thank you both for the reviews! :) |
With this commit we honor the parameter `ingest-percentage` again for bulk requests. Before elastic#763, the method `size()` was used to determine upfront when a parameter source is exhausted. When we changed the API then in elastic#763 the parameter source's progress indication was instead done with the `percent_completed` property but this is only informational and the parameter source is required to raise `StopIteration` to indicate completion. This means that `ingest-percentage` was not considered anymore for bulks but instead we always read the input file(s) completely and then terminated with `StopIteration`. Relates elastic#763
With this commit we honor the parameter `ingest-percentage` again for bulk requests. Before #763, the method `size()` was used to determine upfront when a parameter source is exhausted. When we changed the API then in #763 the parameter source's progress indication was instead done with the `percent_completed` property but this is only informational and the parameter source is required to raise `StopIteration` to indicate completion. This means that `ingest-percentage` was not considered anymore for bulks but instead we always read the input file(s) completely and then terminated with `StopIteration`. Relates #763 Relates #768
There are multiple conditions how a task can be completed. Either the user explicitly specifies a maximum number of iterations or a time-period or a task is implicitly completed when the parameter source is exhausted (e.g. when reading parameters from a file). In the latter case it is not necessary to provide any indication when a task is complete because the parameter source can determine it. However, so far this was required. With this commit we introduce a change in the parameter source API so that it is possible to determine this case and also provide proper progress indication. Furthermore we adapt all parameter sources that come with Rally out of the box and provide guidance for users how to change their own parameter sources. Relates elastic#763
With this commit we honor the parameter `ingest-percentage` again for bulk requests. Before elastic#763, the method `size()` was used to determine upfront when a parameter source is exhausted. When we changed the API then in elastic#763 the parameter source's progress indication was instead done with the `percent_completed` property but this is only informational and the parameter source is required to raise `StopIteration` to indicate completion. This means that `ingest-percentage` was not considered anymore for bulks but instead we always read the input file(s) completely and then terminated with `StopIteration`. Relates elastic#763 Relates elastic#768
There are multiple conditions how a task can be completed. Either the user
explicitly specifies a maximum number of iterations or a time-period or a task
is implicitly completed when the parameter source is exhausted (e.g. when
reading parameters from a file). In the latter case it is not necessary to
provide any indication when a task is complete because the parameter source can
determine it. However, so far this was required.
With this commit we introduce a change in the parameter source API so that it is
possible to determine this case and also provide proper progress indication.
Furthermore we adapt all parameter sources that come with Rally out of the box
and provide guidance for users how to change their own parameter sources.