Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ResponseOps] Updating TM metrics to handle when capacity estimation …
…returns NaN (#207116) Resolves #204467 ## Summary `assumedRequiredThroughputPerMinutePerKibana` is `NaN` when the `capacityStats.runtime.value.load.p90` is undefined. This PR adds a check to catch when the load.p90 is undefined, throw an error, and ignore calculating the capacity estimation. ### Checklist - [ ] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios ### To verify I was not able to reproduce this locally without changing the code, so here is how I tested the code and I am definitely open to suggestions of how to better test this. 1. Update the code to set `capacityStats.runtime.value.load.p90: undefined`. I set it [here](https://github.com/elastic/kibana/blob/286c9e2ddb9f338b0981cc5145bb4179ef7657cb/x-pack/platform/plugins/shared/task_manager/server/monitoring/capacity_estimation.ts#L55), but there are other places upstream where you could set it to `undefined`. 2. Start Kibana 3. Verify that you see the following log message: ``` Task manager had an issue calculating capacity estimation. averageLoadPercentage: undefined ```
- Loading branch information