129 lines
3.5 KiB
Plaintext
129 lines
3.5 KiB
Plaintext
[role="xpack"]
|
|
[testenv="platinum"]
|
|
[[ml-get-job-stats]]
|
|
=== Get {anomaly-job} statistics API
|
|
++++
|
|
<titleabbrev>Get job statistics</titleabbrev>
|
|
++++
|
|
|
|
Retrieves usage information for {anomaly-jobs}.
|
|
|
|
[[ml-get-job-stats-request]]
|
|
==== {api-request-title}
|
|
|
|
`GET _ml/anomaly_detectors/<job_id>/_stats`
|
|
|
|
`GET _ml/anomaly_detectors/<job_id>,<job_id>/_stats` +
|
|
|
|
`GET _ml/anomaly_detectors/_stats` +
|
|
|
|
`GET _ml/anomaly_detectors/_all/_stats`
|
|
|
|
[[ml-get-job-stats-prereqs]]
|
|
==== {api-prereq-title}
|
|
|
|
* If the {es} {security-features} are enabled, you must have `monitor_ml`,
|
|
`monitor`, `manage_ml`, or `manage` cluster privileges to use this API. See
|
|
<<security-privileges>>.
|
|
|
|
[[ml-get-job-stats-desc]]
|
|
==== {api-description-title}
|
|
|
|
You can get statistics for multiple {anomaly-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 {anomaly-jobs} by using `_all`, by specifying `*`
|
|
as the `<job_id>`, or by omitting the `<job_id>`.
|
|
|
|
IMPORTANT: This API returns a maximum of 10,000 jobs.
|
|
|
|
[[ml-get-job-stats-path-parms]]
|
|
==== {api-path-parms-title}
|
|
|
|
`<job_id>`::
|
|
(Optional, string)
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection-default]
|
|
|
|
[[ml-get-job-stats-query-parms]]
|
|
==== {api-query-parms-title}
|
|
|
|
`allow_no_jobs`::
|
|
(Optional, boolean)
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-jobs]
|
|
|
|
[[ml-get-job-stats-results]]
|
|
==== {api-response-body-title}
|
|
|
|
The API returns the following information:
|
|
|
|
`jobs`::
|
|
(array) An array of {anomaly-job} statistics objects.
|
|
|
|
[[ml-get-job-stats-response-codes]]
|
|
==== {api-response-codes-title}
|
|
|
|
`404` (Missing resources)::
|
|
If `allow_no_jobs` is `false`, this code indicates that there are no
|
|
resources that match the request or only partial matches for the request.
|
|
|
|
[[ml-get-job-stats-example]]
|
|
==== {api-examples-title}
|
|
|
|
The following example gets usage information for the `farequote` job:
|
|
|
|
[source,console]
|
|
--------------------------------------------------
|
|
GET _ml/anomaly_detectors/farequote/_stats
|
|
--------------------------------------------------
|
|
// TEST[skip:todo]
|
|
|
|
The API returns the following results:
|
|
[source,js]
|
|
----
|
|
{
|
|
"count": 1,
|
|
"jobs": [
|
|
{
|
|
"job_id": "farequote",
|
|
"data_counts": {
|
|
"job_id": "farequote",
|
|
"processed_record_count": 86275,
|
|
"processed_field_count": 172550,
|
|
"input_bytes": 6744714,
|
|
"input_field_count": 172550,
|
|
"invalid_date_count": 0,
|
|
"missing_field_count": 0,
|
|
"out_of_order_timestamp_count": 0,
|
|
"empty_bucket_count": 0,
|
|
"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
|
|
},
|
|
"model_size_stats": {
|
|
"job_id": "farequote",
|
|
"result_type": "model_size_stats",
|
|
"model_bytes": 387594,
|
|
"total_by_field_count": 21,
|
|
"total_over_field_count": 0,
|
|
"total_partition_field_count": 20,
|
|
"bucket_allocation_failures_count": 0,
|
|
"memory_status": "ok",
|
|
"log_time": 1491948163000,
|
|
"timestamp": 1455234600000
|
|
},
|
|
"state": "closed",
|
|
"timing_stats": {
|
|
"job_id": "farequote",
|
|
"minimum_bucket_processing_time_ms": 0.0,
|
|
"maximum_bucket_processing_time_ms": 15.0,
|
|
"average_bucket_processing_time_ms": 8.75,
|
|
"exponential_average_bucket_processing_time_ms": 6.1435899
|
|
}
|
|
}
|
|
]
|
|
}
|
|
----
|