2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-job-stats]]
|
2017-06-06 16:42:47 -04:00
|
|
|
=== Get Job Statistics
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-26 18:29:55 -04:00
|
|
|
The get jobs API enables you to retrieve usage information for jobs.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Request
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
`GET _xpack/ml/anomaly_detectors/<job_id>/_stats`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-09 11:30:21 -04:00
|
|
|
`GET _xpack/ml/anomaly_detectors/<job_id>,<job_id>/_stats` +
|
|
|
|
|
|
|
|
`GET _xpack/ml/anomaly_detectors/_stats` +
|
|
|
|
|
|
|
|
`GET _xpack/ml/anomaly_detectors/_stats/_all` +
|
|
|
|
|
|
|
|
|
|
|
|
===== Description
|
|
|
|
|
|
|
|
You can get statistics for multiple jobs in a single API request by using a
|
|
|
|
group name, a comma-separated list of jobs, or a wildcard expression. You can
|
|
|
|
get statistics for all jobs by using `_all`, by specifying `*` as the
|
|
|
|
`<job_id>`, or by omitting the `<job_id>`.
|
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Path Parameters
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
`job_id`::
|
2017-08-09 11:30:21 -04:00
|
|
|
(string) An identifier for the job. It can be a job identifier, a group name,
|
|
|
|
or a wildcard expression. If you do not specify one of these options, the API
|
|
|
|
returns statistics for all jobs.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Results
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The API returns the following information:
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
`jobs`::
|
2017-05-08 09:53:04 -04:00
|
|
|
(array) An array of job statistics objects.
|
|
|
|
For more information, see <<ml-jobstats,Job Statistics>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Authorization
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
|
2017-06-19 21:23:58 -04:00
|
|
|
privileges to use this API. For more information, see
|
|
|
|
{xpack-ref}/security-privileges.html[Security Privileges].
|
2017-04-25 17:08:29 -04:00
|
|
|
|
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Examples
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The following example gets usage information for the `farequote` job:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _xpack/ml/anomaly_detectors/farequote/_stats
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
2017-05-08 09:53:04 -04:00
|
|
|
The API returns the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"count": 1,
|
|
|
|
"jobs": [
|
|
|
|
{
|
2017-04-11 21:52:47 -04:00
|
|
|
"job_id": "farequote",
|
2017-04-04 18:26:39 -04:00
|
|
|
"data_counts": {
|
2017-04-11 21:52:47 -04:00
|
|
|
"job_id": "farequote",
|
|
|
|
"processed_record_count": 86275,
|
|
|
|
"processed_field_count": 172550,
|
|
|
|
"input_bytes": 6744714,
|
|
|
|
"input_field_count": 172550,
|
2017-04-04 18:26:39 -04:00
|
|
|
"invalid_date_count": 0,
|
|
|
|
"missing_field_count": 0,
|
|
|
|
"out_of_order_timestamp_count": 0,
|
|
|
|
"empty_bucket_count": 0,
|
2017-04-11 21:52:47 -04:00
|
|
|
"sparse_bucket_count": 15,
|
|
|
|
"bucket_count": 1528,
|
|
|
|
"earliest_record_timestamp": 1454803200000,
|
|
|
|
"latest_record_timestamp": 1455235196000,
|
|
|
|
"last_data_time": 1491948163685,
|
|
|
|
"latest_sparse_bucket_timestamp": 1455174900000,
|
|
|
|
"input_record_count": 86275
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
|
|
|
"model_size_stats": {
|
2017-04-11 21:52:47 -04:00
|
|
|
"job_id": "farequote",
|
2017-04-04 18:26:39 -04:00
|
|
|
"result_type": "model_size_stats",
|
2017-04-11 21:52:47 -04:00
|
|
|
"model_bytes": 387594,
|
|
|
|
"total_by_field_count": 21,
|
2017-04-04 18:26:39 -04:00
|
|
|
"total_over_field_count": 0,
|
2017-04-11 21:52:47 -04:00
|
|
|
"total_partition_field_count": 20,
|
2017-04-04 18:26:39 -04:00
|
|
|
"bucket_allocation_failures_count": 0,
|
|
|
|
"memory_status": "ok",
|
2017-04-11 21:52:47 -04:00
|
|
|
"log_time": 1491948163000,
|
|
|
|
"timestamp": 1455234600000
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
|
|
|
"state": "closed"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|