Skip to content

Commit

Permalink
[ML] Add _cat/ml/anomaly_detectors API (#51364)
Browse files Browse the repository at this point in the history
* [ML] Add _cat/ml/anomaly_detectors/_stats

* addressing PR feedback
  • Loading branch information
benwtrent authored Jan 24, 2020
1 parent 520da54 commit a25f922
Show file tree
Hide file tree
Showing 6 changed files with 745 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,30 @@ public ForecastStats merge(ForecastStats other) {
return this;
}

public long getTotal() {
return total;
}

public long getForecastedJobs() {
return forecastedJobs;
}

public StatsAccumulator getMemoryStats() {
return memoryStats;
}

public StatsAccumulator getRecordStats() {
return recordStats;
}

public StatsAccumulator getRuntimeStats() {
return runtimeStats;
}

public CountAccumulator getStatusCounts() {
return statusCounts;
}

@Override
public XContentBuilder toXContent(XContentBuilder builder, Params params) throws IOException {
builder.startObject();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@
import org.elasticsearch.xpack.ml.rest.calendar.RestPostCalendarEventAction;
import org.elasticsearch.xpack.ml.rest.calendar.RestPutCalendarAction;
import org.elasticsearch.xpack.ml.rest.calendar.RestPutCalendarJobAction;
import org.elasticsearch.xpack.ml.rest.cat.RestCatJobsAction;
import org.elasticsearch.xpack.ml.rest.datafeeds.RestDeleteDatafeedAction;
import org.elasticsearch.xpack.ml.rest.datafeeds.RestGetDatafeedStatsAction;
import org.elasticsearch.xpack.ml.rest.datafeeds.RestGetDatafeedsAction;
Expand Down Expand Up @@ -765,7 +766,9 @@ public List<RestHandler> getRestHandlers(Settings settings, RestController restC
new RestGetTrainedModelsAction(restController),
new RestDeleteTrainedModelAction(restController),
new RestGetTrainedModelsStatsAction(restController),
new RestPutTrainedModelAction(restController)
new RestPutTrainedModelAction(restController),
// CAT Handlers
new RestCatJobsAction(restController)
);
}

Expand Down
Loading

0 comments on commit a25f922

Please sign in to comment.