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] Explain log rate spikes: Fix data out of date when brush selection changes #137791

Conversation

alvarezmelissa87
Copy link
Contributor

@alvarezmelissa87 alvarezmelissa87 commented Aug 1, 2022

Summary

Related meta issue: #136265

This PR updates the run analysis button for the spike analysis table when the brush selection is updated.

Button will go orange and have a warning icon with a tooltip informing the user that the data is out of date and they should rerun the analysis.

image

Checklist

Delete any items that are not applicable to this PR.

@alvarezmelissa87 alvarezmelissa87 added bug Fixes for quality problems that affect the customer experience :ml release_note:skip Skip the PR/issue when compiling release notes auto-backport Deprecated - use backport:version if exact versions are needed v8.4.0 v8.5.0 labels Aug 1, 2022
@alvarezmelissa87 alvarezmelissa87 self-assigned this Aug 1, 2022
@alvarezmelissa87 alvarezmelissa87 requested a review from a team as a code owner August 1, 2022 21:30
@elasticmachine
Copy link
Contributor

Pinging @elastic/ml-ui (:ml)

@@ -82,6 +99,7 @@ export const ExplainLogRateSpikesAnalysis: FC<ExplainLogRateSpikesAnalysisProps>
if (onSelectedChangePoint) {
onSelectedChangePoint(null);
}
setShouldRerunAnalysis(false);
Copy link
Contributor

Choose a reason for hiding this comment

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

This should be replaced with setCurrentAnalysisWindowParameters(windowParameters); similar to the call in the useEffect that trigger the analysis on load.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good catch - updated in 3f2a5c5

Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like that fix wasn't commited/pushed properly, I cannot see it being changed in the latest version, can you try again?

currentAnalysisWindowParameters !== undefined &&
!isEqual(currentAnalysisWindowParameters, windowParameters)
) {
console.log('STALE!!'); // remove
Copy link
Contributor

Choose a reason for hiding this comment

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

This can be removed now.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed in 3f2a5c5

@alvarezmelissa87 alvarezmelissa87 force-pushed the log-rate-spikes-stale-analysis-text branch from 81e75ae to 3f2a5c5 Compare August 2, 2022 14:31
@alvarezmelissa87
Copy link
Contributor Author

This has been updated and is ready for a final look when you get a chance cc @walterra, @darnautov 🙏

@@ -169,8 +169,9 @@ export function DualBrush({
};

if (
baselineSelection[0] !== newBrushPx.baselineMin ||
baselineSelection[1] !== newBrushPx.baselineMax
id === 'baseline' &&
Copy link
Member

Choose a reason for hiding this comment

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

Small suggestion to have 'baseline' and 'deviation' as constants, which can be used in x-pack/packages/ml/aiops_components/src/dual_brush/dual_brush.tsx as well

@qn895
Copy link
Member

qn895 commented Aug 2, 2022

Tested latest changes (as of fe8fa3b) and functionally LGTM. Just left a small comment.

Also, out of scope of this PR, but let's say if I have a bucket/time range selected, clicking on another bucket would not do anything unless I click Clear selection. Might be good to improve on this user experience in a future PR.

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.

Latest update with useMemo works for me! LGTM.

Copy link
Contributor

@darnautov darnautov left a comment

Choose a reason for hiding this comment

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

Code LGTM

@alvarezmelissa87
Copy link
Contributor Author

@elasticmachine merge upstream

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

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
aiops 474.6KB 476.2KB +1.6KB
Unknown metric groups

API count

id before after diff
@kbn/aiops-utils 46 49 +3

History

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

cc @alvarezmelissa87

@kibanamachine
Copy link
Contributor

💚 All backports created successfully

Status Branch Result
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

kibanamachine pushed a commit that referenced this pull request Aug 3, 2022
…on changes (#137791)

* update run analysis button content when selection changges

* fix brush overlap causing endless rerender

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix resize triggering rerun analysis prompt

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* add comments to getSnappedWindowParameters function

* use memo instead of using component state

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix eslint error and simplify usememo callback

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b17579a)
kibanamachine added a commit that referenced this pull request Aug 3, 2022
…on changes (#137791) (#138009)

* update run analysis button content when selection changges

* fix brush overlap causing endless rerender

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix resize triggering rerun analysis prompt

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* add comments to getSnappedWindowParameters function

* use memo instead of using component state

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

* fix eslint error and simplify usememo callback

* [CI] Auto-commit changed files from 'node scripts/precommit_hook.js --ref HEAD~1..HEAD --fix'

Co-authored-by: kibanamachine <[email protected]>
(cherry picked from commit b17579a)

Co-authored-by: Melissa Alvarez <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed bug Fixes for quality problems that affect the customer experience :ml release_note:skip Skip the PR/issue when compiling release notes v8.4.0 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants