Skip to content

Commit

Permalink
[ML] Explain Log Rate Spikes: Replace chunks of queries with concurre…
Browse files Browse the repository at this point in the history
…nt queue. (#144220)

The queries for p-values and histograms were done in chunks of 10 parallel queries. The drawback with this approach was that if just one of these 10 queries was a lot slower, we'd still have to wait for it to finish before we could start the next chunk.  This PR replaces the chunking approach with an async concurrent queue of up to 10 queries. The difference is that as soon as the first of the 10 first queries finishes, we can start another query and don't have to wait for the slower ones to finish.

For this PR the `async` library is added to `package.json`, however it's not a completely new library being added since it was already used as a dependency of other packages we use in Kibana.
  • Loading branch information
walterra authored Nov 4, 2022
1 parent b5ee95d commit 4b61704
Show file tree
Hide file tree
Showing 4 changed files with 180 additions and 172 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -459,6 +459,7 @@
"adm-zip": "^0.5.9",
"antlr4ts": "^0.5.0-alpha.3",
"archiver": "^5.3.1",
"async": "^3.2.3",
"axios": "^0.27.2",
"base64-js": "^1.3.1",
"bitmap-sdf": "^1.0.3",
Expand Down Expand Up @@ -804,6 +805,7 @@
"@testing-library/user-event": "^13.5.0",
"@types/apidoc": "^0.22.3",
"@types/archiver": "^5.3.1",
"@types/async": "^3.2.3",
"@types/babel__core": "^7.1.19",
"@types/babel__generator": "^7.6.4",
"@types/babel__helper-plugin-utils": "^7.10.0",
Expand Down
Loading

0 comments on commit 4b61704

Please sign in to comment.