[ML] only log if forecasts are set to failed (#58421) (#58437)

This adjusts the logging level for setting forecasts to failed to WARN. And it will only log if 1 or more forecasts were adjusted to failed.
This commit is contained in:
Benjamin Trent 2020-06-23 10:24:03 -04:00 committed by GitHub
parent afbf3bd33b
commit 61142a3005
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -1356,7 +1356,9 @@ public class JobResultsProvider {
executeAsyncWithOrigin(client, ML_ORIGIN, UpdateByQueryAction.INSTANCE, request, ActionListener.wrap(
response -> {
LOGGER.info("[{}] set [{}] forecasts to failed", jobId, response.getUpdated());
if (response.getUpdated() > 0) {
LOGGER.warn("[{}] set [{}] forecasts to failed", jobId, response.getUpdated());
}
if (response.getBulkFailures().size() > 0) {
LOGGER.warn(
"[{}] failed to set [{}] forecasts to failed. Bulk failures experienced {}",