2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-datafeed-stats]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Get {dfeed} statistics API
|
2019-04-30 13:46:13 -04:00
|
|
|
|
|
|
|
[subs="attributes"]
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Get {dfeed} statistics</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Retrieves usage information for {dfeeds}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-datafeed-stats-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/datafeeds/<feed_id>/_stats` +
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/datafeeds/<feed_id>,<feed_id>/_stats` +
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`GET _ml/datafeeds/_stats` +
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
`GET _ml/datafeeds/_all/_stats`
|
|
|
|
|
|
|
|
[[ml-get-datafeed-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
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2017-08-09 11:30:21 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-datafeed-stats-desc]]
|
|
|
|
==== {api-description-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-08-09 11:30:21 -04:00
|
|
|
You can get statistics for multiple {dfeeds} in a single API request by using a
|
|
|
|
comma-separated list of {dfeeds} or a wildcard expression. You can get
|
|
|
|
statistics for all {dfeeds} by using `_all`, by specifying `*` as the
|
|
|
|
`<feed_id>`, or by omitting the `<feed_id>`.
|
|
|
|
|
2017-05-02 15:45:42 -04:00
|
|
|
If the {dfeed} is stopped, the only information you receive is the
|
2017-04-10 11:59:27 -04:00
|
|
|
`datafeed_id` and the `state`.
|
|
|
|
|
2019-01-17 13:47:15 -05:00
|
|
|
IMPORTANT: This API returns a maximum of 10,000 {dfeeds}.
|
2017-04-18 18:13:21 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-datafeed-stats-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<feed_id>`::
|
2019-12-30 12:35:16 -05:00
|
|
|
(Optional, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id-wildcard]
|
|
|
|
+
|
|
|
|
--
|
|
|
|
If you do not specify one of these options, the API returns information about
|
|
|
|
all {dfeeds}.
|
|
|
|
--
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-25 10:45:06 -04:00
|
|
|
[[ml-get-datafeed-stats-query-parms]]
|
|
|
|
==== {api-query-parms-title}
|
|
|
|
|
|
|
|
`allow_no_datafeeds`::
|
2019-12-30 12:35:16 -05:00
|
|
|
(Optional, boolean)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=allow-no-datafeeds]
|
2019-07-25 10:45:06 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-datafeed-stats-results]]
|
|
|
|
==== {api-response-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-30 12:35:16 -05:00
|
|
|
The API returns an array of {dfeed} count objects. All of these properties are
|
|
|
|
informational; you cannot update their values.
|
|
|
|
|
|
|
|
`assignment_explanation`::
|
2020-02-26 12:20:36 -05:00
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=assignment-explanation]
|
2019-12-30 12:35:16 -05:00
|
|
|
|
|
|
|
`datafeed_id`::
|
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=datafeed-id]
|
|
|
|
|
|
|
|
`node`::
|
2020-02-26 12:20:36 -05:00
|
|
|
(object)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=node]
|
|
|
|
`node`.`id`::: The unique identifier of the node. For example, "0-o0tOoRTwKFZifatTWKNw".
|
2019-12-30 12:35:16 -05:00
|
|
|
`node`.`name`::: The node name. For example, `0-o0tOo`.
|
|
|
|
`node`.`ephemeral_id`::: The node ephemeral ID.
|
|
|
|
`node`.`transport_address`::: The host and port where transport HTTP connections
|
|
|
|
are accepted. For example, `127.0.0.1:9300`.
|
|
|
|
`node`.`attributes`::: For example, `{"ml.machine_memory": "17179869184"}`.
|
|
|
|
|
|
|
|
`state`::
|
2020-02-26 12:20:36 -05:00
|
|
|
(string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=state-datafeed]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-30 12:35:16 -05:00
|
|
|
`timing_stats`::
|
|
|
|
(object) An object that provides statistical information about timing aspect of
|
|
|
|
this {dfeed}.
|
2020-02-26 12:20:36 -05:00
|
|
|
|
2020-01-03 12:07:08 -05:00
|
|
|
`timing_stats`.`average_search_time_per_bucket_ms`:::
|
2020-02-26 12:20:36 -05:00
|
|
|
(double)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=search-bucket-avg]
|
|
|
|
|
2020-01-03 12:07:08 -05:00
|
|
|
`timing_stats`.`bucket_count`:::
|
2020-02-26 12:20:36 -05:00
|
|
|
(long)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=bucket-count]
|
|
|
|
|
2020-01-03 12:07:08 -05:00
|
|
|
`timing_stats`.`exponential_average_search_time_per_hour_ms`:::
|
2020-02-26 12:20:36 -05:00
|
|
|
(double)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=search-exp-avg-hour]
|
|
|
|
|
2019-12-30 12:35:16 -05:00
|
|
|
`timing_stats`.`job_id`:::
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2020-02-26 12:20:36 -05:00
|
|
|
|
|
|
|
`timing_stats`.`search_count`:::
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=search-count]
|
|
|
|
|
|
|
|
`timing_stats`.`total_search_time_ms`:::
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=search-time]
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-25 10:45:06 -04:00
|
|
|
[[ml-get-datafeed-stats-response-codes]]
|
|
|
|
==== {api-response-codes-title}
|
|
|
|
|
|
|
|
`404` (Missing resources)::
|
|
|
|
If `allow_no_datafeeds` is `false`, this code indicates that there are no
|
|
|
|
resources that match the request or only partial matches for the request.
|
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-get-datafeed-stats-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-11 21:52:47 -04:00
|
|
|
--------------------------------------------------
|
2019-12-30 12:35:16 -05:00
|
|
|
GET _ml/datafeeds/datafeed-high_sum_total_sales/_stats
|
2017-04-11 21:52:47 -04:00
|
|
|
--------------------------------------------------
|
2019-12-30 12:35:16 -05:00
|
|
|
// TEST[skip:Kibana sample data started datafeed]
|
2017-04-11 21:52:47 -04:00
|
|
|
|
|
|
|
The API returns the following results:
|
2019-09-06 16:09:09 -04:00
|
|
|
|
|
|
|
[source,console-result]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
|
|
|
"count": 1,
|
2017-04-10 11:59:27 -04:00
|
|
|
"datafeeds": [
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2019-12-30 12:35:16 -05:00
|
|
|
"datafeed_id": "datafeed-high_sum_total_sales",
|
2017-04-10 11:59:27 -04:00
|
|
|
"state": "started",
|
|
|
|
"node": {
|
2018-02-20 14:08:37 -05:00
|
|
|
"id": "2spCyo1pRi2Ajo-j-_dnPX",
|
|
|
|
"name": "node-0",
|
|
|
|
"ephemeral_id": "hoXMLZB0RWKfR9UPPUCxXX",
|
2017-04-10 11:59:27 -04:00
|
|
|
"transport_address": "127.0.0.1:9300",
|
|
|
|
"attributes": {
|
2018-02-20 14:08:37 -05:00
|
|
|
"ml.machine_memory": "17179869184",
|
2019-03-06 07:29:34 -05:00
|
|
|
"ml.max_open_jobs": "20"
|
2017-04-10 11:59:27 -04:00
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
2019-07-10 05:51:44 -04:00
|
|
|
"assignment_explanation": "",
|
|
|
|
"timing_stats": {
|
2019-12-30 12:35:16 -05:00
|
|
|
"job_id" : "high_sum_total_sales",
|
|
|
|
"search_count" : 27,
|
|
|
|
"bucket_count" : 619,
|
|
|
|
"total_search_time_ms" : 296.0,
|
|
|
|
"average_search_time_per_bucket_ms" : 0.4781906300484653,
|
|
|
|
"exponential_average_search_time_per_hour_ms" : 33.28246548059884
|
2019-07-10 05:51:44 -04:00
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|
2018-02-20 14:08:37 -05:00
|
|
|
// TESTRESPONSE[s/"2spCyo1pRi2Ajo-j-_dnPX"/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/"node-0"/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/"hoXMLZB0RWKfR9UPPUCxXX"/$body.$_path/]
|
|
|
|
// TESTRESPONSE[s/"127.0.0.1:9300"/$body.$_path/]
|
2018-12-07 15:34:11 -05:00
|
|
|
// TESTRESPONSE[s/"17179869184"/$body.datafeeds.0.node.attributes.ml\\.machine_memory/]
|