2017-04-11 21:52:47 -04:00
|
|
|
//lcawley Verified example output 2017-04-11
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-job-stats]]
|
|
|
|
==== Get Job Statistics
|
|
|
|
|
|
|
|
The get jobs API allows you to retrieve usage information for jobs.
|
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Request
|
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
`GET _xpack/ml/anomaly_detectors/_stats` +
|
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-04-25 17:08:29 -04:00
|
|
|
//===== Description
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Path Parameters
|
|
|
|
|
|
|
|
`job_id`::
|
2017-04-24 13:46:17 -04:00
|
|
|
(string) A required identifier for the job.
|
|
|
|
This parameter does not support wildcards, but you can specify `_all` or omit
|
|
|
|
the `job_id` to get information about all jobs.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
|
|
|
|
===== Results
|
|
|
|
|
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-04-11 22:26:18 -04:00
|
|
|
(array) An array of job count objects.
|
2017-04-19 13:52:30 -04:00
|
|
|
For more information, see <<ml-jobstats,Job Stats>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
===== Authorization
|
|
|
|
|
|
|
|
You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
|
|
|
|
privileges to use this API. For more information, see <<privileges-list-cluster>>.
|
|
|
|
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Examples
|
|
|
|
|
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]
|
|
|
|
|
|
|
|
In this example, the API returns a single result that matches the specified
|
|
|
|
score and time constraints:
|
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"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|