2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-get-datafeed-stats]]
|
2017-12-14 13:52:49 -05:00
|
|
|
=== Get {dfeed-cap} Statistics API
|
|
|
|
++++
|
|
|
|
<titleabbrev>Get {dfeed-cap} Statistics</titleabbrev>
|
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-01-15 11:44:08 -05:00
|
|
|
This API enables you to retrieve usage information for {dfeeds}.
|
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
|
|
|
`GET _xpack/ml/datafeeds/<feed_id>/_stats` +
|
|
|
|
|
|
|
|
`GET _xpack/ml/datafeeds/<feed_id>,<feed_id>/_stats` +
|
|
|
|
|
|
|
|
`GET _xpack/ml/datafeeds/_stats` +
|
|
|
|
|
|
|
|
`GET _xpack/ml/datafeeds/_stats/_all` +
|
|
|
|
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -04:00
|
|
|
|
2017-06-06 16:42:47 -04:00
|
|
|
==== Description
|
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`.
|
|
|
|
|
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
|
|
|
|
|
|
|
`feed_id`::
|
2017-08-09 11:30:21 -04:00
|
|
|
(string) Identifier for the {dfeed}. It can be a {dfeed} identifier or a
|
|
|
|
wildcard expression. If you do not specify one of these options, the API
|
|
|
|
returns statistics for all {dfeeds}.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-25 17:08:29 -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
|
|
|
`datafeeds`::
|
2017-05-02 15:45:42 -04:00
|
|
|
(array) An array of {dfeed} count objects.
|
|
|
|
For more information, see <<ml-datafeed-counts>>.
|
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
|
2018-02-20 14:08:37 -05:00
|
|
|
`datafeed-total-requests` {dfeed}:
|
2017-04-11 21:52:47 -04:00
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
2018-02-20 14:08:37 -05:00
|
|
|
GET _xpack/ml/datafeeds/datafeed-total-requests/_stats
|
2017-04-11 21:52:47 -04:00
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
2018-02-21 05:03:20 -05:00
|
|
|
// TEST[skip:https://github.com/elastic/x-pack-elasticsearch/issues/4004]
|
2017-04-11 21:52:47 -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,
|
2017-04-10 11:59:27 -04:00
|
|
|
"datafeeds": [
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2018-02-20 14:08:37 -05:00
|
|
|
"datafeed_id": "datafeed-total-requests",
|
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",
|
|
|
|
"ml.max_open_jobs": "20",
|
2017-06-09 10:48:51 -04:00
|
|
|
"ml.enabled": "true"
|
2017-04-10 11:59:27 -04:00
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
},
|
2017-04-11 21:52:47 -04:00
|
|
|
"assignment_explanation": ""
|
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-02-20 21:36:56 -05:00
|
|
|
// TESTRESONSE[s/"17179869184"/$body.$_path/]
|