Skip to content

Commit

Permalink
[ML] Make GetJobStats work with arbitrary wildcards and groups (#36683)
Browse files Browse the repository at this point in the history
The /_ml/anomaly_detectors/{job}/_stats endpoint now
works correctly when {job} is a wildcard or job group.

Closes #34745
  • Loading branch information
henriquegoncalves98 authored and droberts195 committed Jan 29, 2019
1 parent ebe9c95 commit eceb318
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public boolean allowNoJobs() {

@Override
public boolean match(Task task) {
return OpenJobAction.JobTaskMatcher.match(task, jobId);
return expandedJobsIds.stream().anyMatch(jobId -> OpenJobAction.JobTaskMatcher.match(task, jobId));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public void testDetermineJobIds() {

result = determineJobIdsWithoutLiveStats(Arrays.asList("id1", "id2", "id3"),
Collections.singletonList(new GetJobsStatsAction.Response.JobStats("id1", new DataCounts("id1"), null, null,
JobState.CLOSED, null, null, null))
JobState.OPENED, null, null, null))
);
assertEquals(2, result.size());
assertEquals("id2", result.get(0));
Expand Down

0 comments on commit eceb318

Please sign in to comment.