[Monitoring] Stop a new request when one is inflight#27253
Merged
chrisronline merged 9 commits intoelastic:masterfrom Dec 17, 2018
Merged
[Monitoring] Stop a new request when one is inflight#27253chrisronline merged 9 commits intoelastic:masterfrom
chrisronline merged 9 commits intoelastic:masterfrom
Conversation
…e to stop a new request when one is inflight
Contributor
|
Pinging @elastic/stack-monitoring |
Member
|
Could you possibly split this so that the Logstash monitoring UI changes are in a separate PR? It looks like the meat of the core change here is quite small. |
Contributor
💔 Build Failed |
Contributor
Author
|
@pickypg Done! |
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
Contributor
💔 Build Failed |
Contributor
Author
|
retest |
Contributor
💚 Build Succeeded |
pickypg
reviewed
Dec 17, 2018
Member
pickypg
left a comment
There was a problem hiding this comment.
I'm most concerned about base_controller.js's updates. And those LGTM, but I think could be improved a little.
| this.updateDataPromise = null; | ||
| this.updatingData = false; | ||
| this.updateData = () => { | ||
| if (this.updatingData) { |
Member
There was a problem hiding this comment.
We could simplify this and remove this.updatingData altogether by simply checking this.updateDataPromise, then just set this.updateDataPromise = null;, which we should probably do regardless, instead of this.updatingData = false;.
Contributor
Author
|
@pickypg Updated! |
Contributor
💚 Build Succeeded |
chrisronline
added a commit
to chrisronline/kibana
that referenced
this pull request
Dec 17, 2018
* Convert all pages to use the base controlller, then add logic in there to stop a new request when one is inflight * Reuse the promise * Undo logstash changes * Update in catch too * Add unit test * Fix cluster name showing up * Update broken test * Just use updateDataPromise
chrisronline
added a commit
that referenced
this pull request
Dec 17, 2018
* Convert all pages to use the base controlller, then add logic in there to stop a new request when one is inflight * Reuse the promise * Undo logstash changes * Update in catch too * Add unit test * Fix cluster name showing up * Update broken test * Just use updateDataPromise
Contributor
Author
|
Backport: 6.x: 6d2b61f |
Member
|
Nice improvement for "Killbana" mitigation. ++ |
7 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #24082
This PR adds code to prevent an additional API request if there is one in-flight. However, in order to make this work properly for all monitoring UI pages, we need to update the legacy ones to properly use the base controller. This PR includes that work as well.
Testing
NOTE: This is just how I tested it and feel free to find another way if this doesn't work for you.

3) In the URL address bar, change the interval to 1s (or 1000ms):
4) In the browser dev tools, turn on throttling: