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] Fixing overview page max anomaly score #48110

Merged
merged 2 commits into from
Oct 16, 2019

Conversation

jgowdyelastic
Copy link
Member

@jgowdyelastic jgowdyelastic commented Oct 14, 2019

Fixes max anomaly scores on overview page if, for whatever reason, the scores can't be loaded for a group.
Changes the endpoint to return JSON rather than a number.

before:
image

After:
image

Checklist

Use strikethroughs to remove checklist items you don't feel are applicable to this PR.

- [ ] This was checked for cross-browser compatibility, including a check against IE11
- [ ] Any text added follows EUI's writing guidelines, uses sentence case text and includes i18n support
- [ ] Documentation was added for features that require explanation or tutorials
- [ ] Unit or functional tests were updated or added to match the most common scenarios
- [ ] This was checked for keyboard-only and screenreader accessibility

For maintainers

- [ ] This was checked for breaking API changes and was labeled appropriately
- [ ] This includes a feature addition or change that requires a release note and was labeled appropriately

@jgowdyelastic jgowdyelastic requested a review from a team as a code owner October 14, 2019 14:45
@jgowdyelastic jgowdyelastic changed the title [ML] Fixing overview page max anomaly score [ML] [DRAFT] Fixing overview page max anomaly score Oct 14, 2019
@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@alvarezmelissa87 alvarezmelissa87 self-requested a review October 14, 2019 21:45
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡️Nice find - thank you! 🙌

@jgowdyelastic jgowdyelastic self-assigned this Oct 15, 2019
@jgowdyelastic jgowdyelastic added :ml bug Fixes for quality problems that affect the customer experience non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes review v7.5.0 v8.0.0 labels Oct 15, 2019
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

scores[groupId] = resultsIndex !== undefined && results[resultsIndex];
tempGroups[groupId].max_anomaly_score = resultsIndex !== undefined && results[resultsIndex];
const { maxScore } = resultsIndex !== undefined && results[resultsIndex];
scores[groupId].maxScore = maxScore || undefined;
Copy link
Member Author

Choose a reason for hiding this comment

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

@alvarezmelissa87 is this line needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

The undefined is just used as a check in the displaying component so we know when to show the warning icon - we do an explicit check for undefined to see if the maxScore was not properly loaded.
If on line 106 the maxScore is already undefined when not found then I don't think we need it.
I'd lean toward keeping it to ensure we're always getting undefined when maxScore doesn't get set correctly. 🤔

Copy link
Member Author

@jgowdyelastic jgowdyelastic Oct 15, 2019

Choose a reason for hiding this comment

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

but as far as i can tell tempGroups on the line below is used for that check.
it doesn't look like scores is used after this loop over its keys

Copy link
Member Author

Choose a reason for hiding this comment

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

from my tests this line isn't needed, so i'm removing it.

@jgowdyelastic jgowdyelastic changed the title [ML] [DRAFT] Fixing overview page max anomaly score [ML] Fixing overview page max anomaly score Oct 15, 2019
Copy link
Contributor

@peteharverson peteharverson left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 left a comment

Choose a reason for hiding this comment

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

LGTM ⚡️ Good find - thank you! 🙏

Copy link
Contributor

@walterra walterra left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticmachine
Copy link
Contributor

💚 Build Succeeded

@jgowdyelastic jgowdyelastic merged commit 68a2fdc into elastic:master Oct 16, 2019
@jgowdyelastic jgowdyelastic deleted the fixing-overview-max-score branch October 16, 2019 07:08
jgowdyelastic added a commit to jgowdyelastic/kibana that referenced this pull request Oct 16, 2019
* [ML] Fixing overview page max anomaly score

* removing unnecessary copy of maxScore
jgowdyelastic added a commit that referenced this pull request Oct 16, 2019
* [ML] Fixing overview page max anomaly score

* removing unnecessary copy of maxScore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Fixes for quality problems that affect the customer experience :ml non-issue Indicates to automation that a pull request should not appear in the release notes release_note:skip Skip the PR/issue when compiling release notes review v7.5.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants