Skip to content
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

[ML] Fix Single Metric Viewer chart failing to load if no points during a calendar event #128808

Closed
wants to merge 4 commits into from

Conversation

qn895
Copy link
Member

@qn895 qn895 commented Mar 29, 2022

Summary

This PR fixes #128462 where Single Metric Viewer chart fails to load if no points during a calendar event.

Before
Screen Shot 2022-03-29 at 14 02 41

After
Screen Shot 2022-03-29 at 14 01 48

Checklist

Delete any items that are not applicable to this PR.

Risk Matrix

Delete this section if it is not applicable to this PR.

Before closing this PR, invite QA, stakeholders, and other developers to identify risks that should be tested prior to the change/feature release.

When forming the risk matrix, consider some of the following examples and how they may potentially impact the change:

Risk Probability Severity Mitigation/Notes
Multiple Spaces—unexpected behavior in non-default Kibana Space. Low High Integration tests will verify that all features are still supported in non-default Kibana Space and when user switches between spaces.
Multiple nodes—Elasticsearch polling might have race conditions when multiple Kibana nodes are polling for the same tasks. High Low Tasks are idempotent, so executing them multiple times will not result in logical error, but will degrade performance. To test for this case we add plenty of unit tests around this logic and document manual testing procedure.
Code should gracefully handle cases when feature X or plugin Y are disabled. Medium High Unit tests will verify that any feature flag or plugin combination still results in our service operational.
See more potential risk examples

For maintainers

@qn895 qn895 requested review from walterra and peteharverson March 29, 2022 19:04
@qn895 qn895 requested a review from a team as a code owner March 29, 2022 19:04
@qn895 qn895 self-assigned this Mar 29, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@peteharverson
Copy link
Contributor

Ideally we should be adding points for the calendar events to the charts - adding points, with the usual rectangular scheduled event marker, at chart aggregation interval during the time span of the calendar event, with y-axis values at 0. Is this possible?

if (itemTime > time) {
const item = chartData[i];
const previousItem = chartData[i - 1];

const diff1 = Math.abs(time - previousItem.date.getTime());
const diff1 = Math.abs(time - previousItem?.date?.getTime());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This diff1 will be NaN if previousItem is undefined - is that intended?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine as it's only used for a boolean check

@kibana-ci
Copy link
Collaborator

kibana-ci commented Apr 4, 2022

💔 Build Failed

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
ml 3.3MB 3.3MB +562.0B
Unknown metric groups

ESLint disabled in files

id before after diff
apm 15 14 -1
securitySolution 69 68 -1
uptime 7 6 -1
total -3

ESLint disabled line counts

id before after diff
apm 88 85 -3
uptime 49 43 -6
total -9

Total ESLint disabled count

id before after diff
apm 103 99 -4
securitySolution 511 510 -1
uptime 56 49 -7
total -12

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @qn895

@peteharverson
Copy link
Contributor

Closing in favor of #130000.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ML] Single Metric Viewer chart fails to load if no points during a calendar event
5 participants