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

Fix bug of HC historical results not auto-refreshing #131

Merged
merged 1 commit into from
Nov 10, 2021

Conversation

ohltyler
Copy link
Member

@ohltyler ohltyler commented Nov 10, 2021

Signed-off-by: Tyler Ohlsen ohltyler@amazon.com

Description

Fixes a bug where heatmap chart data doesn't auto-refresh properly in the historical scenario. Note that the data would still show fine if the page was refreshed (switched tabs, etc.).

The bug was that the entity-level anomaly summaries weren't being fetched during the auto-refresh codepath, and were always being passed as an empty list. The heatmap chart data is prepared using the summaries, and so because the summaries were always empty, the heatmap chart data was always subsequently empty.

The fix is to add a call to fetch the entity summaries (fetchHCAnomalySummaries()) after fetching the raw results (fetchRawAnomalyResults()) in AnomalyHistory, which is rendered as a child component in HistoricalDetectorResults. Note that fetchRawAnomalyResults() is called in a custom hook (see lines 353-363), which is listening on changes for props.detector. And, props.detector is changed during auto refresh, where the task progress is updated (props.detector.taskProgress), hence triggering this whole workflow.

Confirmed nothing breaks after historical job is FINISHED/STOPPED, as well as real-time scenarios.

Issues Resolved

Closes #130

Check List

  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
@ohltyler ohltyler added bug Something isn't working v1.2.0 Version 1.2.0 labels Nov 10, 2021
@ohltyler ohltyler merged commit 3b19e06 into opensearch-project:main Nov 10, 2021
@ohltyler ohltyler deleted the refresh-bug-2 branch November 10, 2021 02:02
ohltyler added a commit to ohltyler/anomaly-detection-dashboards-plugin-1 that referenced this pull request Nov 10, 2021
ohltyler added a commit to ohltyler/anomaly-detection-dashboards-plugin-1 that referenced this pull request Nov 10, 2021
ohltyler added a commit that referenced this pull request Nov 10, 2021
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
ohltyler added a commit that referenced this pull request Nov 10, 2021
Signed-off-by: Tyler Ohlsen <ohltyler@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working v1.2.0 Version 1.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

HC historical analysis result heat map doesn't auto load result
3 participants