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-datafeed-stats]]
|
|
|
|
==== Get Data Feed Statistics
|
|
|
|
|
2017-04-11 21:52:47 -04:00
|
|
|
The get data feed statistics API enables you to retrieve usage information for
|
2017-04-10 11:59:27 -04:00
|
|
|
data feeds.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Request
|
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
`GET _xpack/ml/datafeeds/_stats` +
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-06 10:56:46 -04:00
|
|
|
`GET _xpack/ml/datafeeds/<feed_id>/_stats`
|
2017-04-04 18:26:39 -04:00
|
|
|
|
|
|
|
===== Description
|
|
|
|
|
2017-04-10 11:59:27 -04:00
|
|
|
If the data feed is stopped, the only information you receive is the
|
|
|
|
`datafeed_id` and the `state`.
|
|
|
|
|
2017-04-18 18:13:21 -04:00
|
|
|
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
|
|
|
===== Path Parameters
|
|
|
|
|
|
|
|
`feed_id`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(string) Identifier for the data feed.
|
2017-04-10 11:59:27 -04:00
|
|
|
If you do not specify this optional parameter, the API returns information
|
2017-04-18 18:13:21 -04:00
|
|
|
about all data feeds.
|
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
|
|
|
`datafeeds`::
|
2017-04-11 22:26:18 -04:00
|
|
|
(array) An array of data feed count objects.
|
2017-04-11 21:52:47 -04:00
|
|
|
For more information, see <<ml-datafeed-counts,Data Feed Counts>>.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-10 11:59:27 -04:00
|
|
|
////
|
2017-04-04 18:26:39 -04:00
|
|
|
===== Responses
|
|
|
|
|
|
|
|
200
|
|
|
|
(EmptyResponse) The cluster has been successfully deleted
|
|
|
|
404
|
|
|
|
(BasicFailedReply) The cluster specified by {cluster_id} cannot be found (code: clusters.cluster_not_found)
|
|
|
|
412
|
|
|
|
(BasicFailedReply) The Elasticsearch cluster has not been shutdown yet (code: clusters.cluster_plan_state_error)
|
2017-04-10 11:59:27 -04:00
|
|
|
////
|
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
|
|
|
|
`datafeed-farequote` data feed:
|
|
|
|
|
|
|
|
[source,js]
|
|
|
|
--------------------------------------------------
|
|
|
|
GET _xpack/ml/datafeeds/datafeed-farequote/_stats
|
|
|
|
--------------------------------------------------
|
|
|
|
// CONSOLE
|
|
|
|
// TEST[skip:todo]
|
|
|
|
|
|
|
|
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
|
|
|
{
|
2017-04-10 11:59:27 -04:00
|
|
|
"datafeed_id": "datafeed-farequote",
|
|
|
|
"state": "started",
|
|
|
|
"node": {
|
2017-04-11 21:52:47 -04:00
|
|
|
"id": "IO_gxe2_S8mrzu7OpmK5Jw",
|
|
|
|
"name": "IO_gxe2",
|
|
|
|
"ephemeral_id": "KHMWPZoMToOzSsZY9lDDgQ",
|
2017-04-10 11:59:27 -04:00
|
|
|
"transport_address": "127.0.0.1:9300",
|
|
|
|
"attributes": {
|
|
|
|
"max_running_jobs": "10"
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
----
|