-
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] Anomaly Detection: when no anomalies present for time range show no results message #91151
Changes from 4 commits
ffe383a
4de2426
26bd68c
feb0062
1e10d7a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,6 +142,7 @@ export class Explorer extends React.Component { | |
setSelectedCells: PropTypes.func.isRequired, | ||
severity: PropTypes.number.isRequired, | ||
showCharts: PropTypes.bool.isRequired, | ||
selectedJobsRunning: PropTypes.bool.isRequired, | ||
}; | ||
|
||
state = { filterIconTriggeredQuery: undefined, language: DEFAULT_QUERY_LANG }; | ||
|
@@ -223,7 +224,7 @@ export class Explorer extends React.Component { | |
updateLanguage = (language) => this.setState({ language }); | ||
|
||
render() { | ||
const { showCharts, severity, stoppedPartitions } = this.props; | ||
const { showCharts, severity, stoppedPartitions, selectedJobsRunning } = this.props; | ||
|
||
const { | ||
annotations, | ||
|
@@ -248,6 +249,9 @@ export class Explorer extends React.Component { | |
|
||
const noJobsFound = selectedJobs === null || selectedJobs.length === 0; | ||
const hasResults = overallSwimlaneData.points && overallSwimlaneData.points.length > 0; | ||
const hasResultsWithAnomalies = | ||
(hasResults && overallSwimlaneData.points.some((v) => v.value > 0)) || | ||
tableData.anomalies?.length > 0; | ||
|
||
if (noJobsFound && !loading) { | ||
return ( | ||
|
@@ -257,10 +261,14 @@ export class Explorer extends React.Component { | |
); | ||
} | ||
|
||
if (noJobsFound && hasResults === false && !loading) { | ||
if (hasResultsWithAnomalies === false && !loading) { | ||
return ( | ||
<ExplorerPage jobSelectorProps={jobSelectorProps}> | ||
<ExplorerNoResultsFound /> | ||
<ExplorerNoResultsFound | ||
hasResults={hasResults} | ||
hasResultsWithAnomalies={hasResultsWithAnomalies} | ||
selectedJobsRunning={selectedJobsRunning} | ||
/> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good call - missed removing it. 👍 Updated in 1e10d7a |
||
</ExplorerPage> | ||
); | ||
} | ||
|
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 check needs amending as it means the 'No anomalies' message is shown in the following situations:
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, @peteharverson. Updated
hasResultsWithAnomalies
check in feb0062So
hasResults
means we get something back from the overall bucket endpoint (when there are no anomalous records at all we get empty results from the overall bucket endpoint) andhasResultsWithAnomalies
means those overall bucket scores are > 0 OR we get some anomaly records back for populating the table.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.
If it's true that this section is related to overall bucket scores, perhaps the message could be something like this:
We talk about "overall buckets" in the docs in at least two places, in case it needs to be linked: https://www.elastic.co/guide/en/machine-learning/master/ml-buckets.html and https://www.elastic.co/guide/en/elasticsearch/reference/master/ml-get-overall-buckets.html
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.
Thanks for taking a look @lcawl - updated the message in 1e10d7a
Added screen shot to the PR description above as well 👌