-
Notifications
You must be signed in to change notification settings - Fork 25.6k
[DOCS] Document throttle_period_in_millis for watcher actions
#45607
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
[DOCS] Document throttle_period_in_millis for watcher actions
#45607
Conversation
|
Pinging @elastic/es-core-features |
|
Pinging @elastic/es-docs |
|
@elasticmachine run elasticsearch-ci/2 |
szabosteve
left a comment
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.
hub-cap
left a comment
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.
other than changing the wording on the overrides, this is LGTM.
| for this is 5 seconds. This default can be changed in the | ||
| config file with the setting `xpack.watcher.throttle.period.default_period`. | ||
| config file with the setting | ||
| `xpack.watcher.throttle.period.default_period`. If |
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.
Hey i did a quick eyeball of the code here and it looks like this is not correct. The code is basically "last one wins" due to the for loop + non final variable assignment when parsing the watch.
So if you have
"throttle_period_in_millis": "7000",
"throttle_period": "5s",
the GET watch API returns throttle_period_in_millis":5000,
and if you have the opposite,
"throttle_period": "5s",
"throttle_period_in_millis": "7000",
the GET watch API returns throttle_period_in_millis":7000,
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.
Here is the code im talking about for reference,
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.
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.
So its not about one overriding the other, its about which one is declared first in the watch. if you declare both, the last one overrides the first one, so you can see in the example above that when i declared them both, which i did in 2 watches, the output was different based on which order they were declared in.
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.
🤦♂ Sorry about that. Guess I'm feeling dense today.
Corrected again with deaef45.
|
|
||
| | `throttle_period_in_millis` | Minimum time in milliseconds between actions | ||
| being run. Defaults to `5000`. If provided, this | ||
| value overrides the `throttle_period` value. |
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.
same here WRT the overrides.
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.
Fixed with cfe41d9.
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.
Corrected again with deaef45.
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.
💥
Closes #45346.
Preview
http://elasticsearch_45607.docs-preview.app.elstc.co/guide/en/elasticsearch/reference/master/watcher-api-put-watch.html#_request_body_7