-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[ML] Explain log rate spikes: Fix data out of date when brush selection changes #137791
Conversation
Pinging @elastic/ml-ui (:ml) |
...plugins/aiops/public/components/explain_log_rate_spikes/explain_log_rate_spikes_analysis.tsx
Outdated
Show resolved
Hide resolved
x-pack/packages/ml/aiops_components/src/progress_controls/progress_controls.tsx
Outdated
Show resolved
Hide resolved
@@ -82,6 +99,7 @@ export const ExplainLogRateSpikesAnalysis: FC<ExplainLogRateSpikesAnalysisProps> | |||
if (onSelectedChangePoint) { | |||
onSelectedChangePoint(null); | |||
} | |||
setShouldRerunAnalysis(false); |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed in 3f2a5c5
81e75ae
to
3f2a5c5
Compare
…-ref HEAD~1..HEAD --fix'
…-ref HEAD~1..HEAD --fix'
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' && |
There was a problem hiding this comment.
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
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 |
There was a problem hiding this 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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code LGTM
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]Async chunks
History
To update your PR or re-run it, just comment with: |
💚 All backports created successfully
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 |
…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)
…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]>
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.
Checklist
Delete any items that are not applicable to this PR.