get-datafeed-stats.asciidoc 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. [role="xpack"]
  2. [[ml-get-datafeed-stats]]
  3. === Get {dfeed-cap} Statistics API
  4. ++++
  5. <titleabbrev>Get {dfeed-cap} Statistics</titleabbrev>
  6. ++++
  7. Retrieves usage information for {dfeeds}.
  8. ==== Request
  9. `GET _xpack/ml/datafeeds/<feed_id>/_stats` +
  10. `GET _xpack/ml/datafeeds/<feed_id>,<feed_id>/_stats` +
  11. `GET _xpack/ml/datafeeds/_stats` +
  12. `GET _xpack/ml/datafeeds/_all/_stats` +
  13. ==== Description
  14. You can get statistics for multiple {dfeeds} in a single API request by using a
  15. comma-separated list of {dfeeds} or a wildcard expression. You can get
  16. statistics for all {dfeeds} by using `_all`, by specifying `*` as the
  17. `<feed_id>`, or by omitting the `<feed_id>`.
  18. If the {dfeed} is stopped, the only information you receive is the
  19. `datafeed_id` and the `state`.
  20. ==== Path Parameters
  21. `feed_id`::
  22. (string) Identifier for the {dfeed}. It can be a {dfeed} identifier or a
  23. wildcard expression. If you do not specify one of these options, the API
  24. returns statistics for all {dfeeds}.
  25. ==== Results
  26. The API returns the following information:
  27. `datafeeds`::
  28. (array) An array of {dfeed} count objects.
  29. For more information, see <<ml-datafeed-counts>>.
  30. ==== Authorization
  31. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  32. privileges to use this API. For more information, see
  33. {xpack-ref}/security-privileges.html[Security Privileges].
  34. ==== Examples
  35. The following example gets usage information for the
  36. `datafeed-total-requests` {dfeed}:
  37. [source,js]
  38. --------------------------------------------------
  39. GET _xpack/ml/datafeeds/datafeed-total-requests/_stats
  40. --------------------------------------------------
  41. // CONSOLE
  42. // TEST[setup:server_metrics_startdf]
  43. The API returns the following results:
  44. [source,js]
  45. ----
  46. {
  47. "count": 1,
  48. "datafeeds": [
  49. {
  50. "datafeed_id": "datafeed-total-requests",
  51. "state": "started",
  52. "node": {
  53. "id": "2spCyo1pRi2Ajo-j-_dnPX",
  54. "name": "node-0",
  55. "ephemeral_id": "hoXMLZB0RWKfR9UPPUCxXX",
  56. "transport_address": "127.0.0.1:9300",
  57. "attributes": {
  58. "ml.machine_memory": "17179869184",
  59. "ml.max_open_jobs": "20",
  60. "ml.enabled": "true"
  61. }
  62. },
  63. "assignment_explanation": ""
  64. }
  65. ]
  66. }
  67. ----
  68. // TESTRESPONSE[s/"2spCyo1pRi2Ajo-j-_dnPX"/$body.$_path/]
  69. // TESTRESPONSE[s/"node-0"/$body.$_path/]
  70. // TESTRESPONSE[s/"hoXMLZB0RWKfR9UPPUCxXX"/$body.$_path/]
  71. // TESTRESPONSE[s/"127.0.0.1:9300"/$body.$_path/]
  72. // TESTRESPONSE[s/"17179869184"/$body.datafeeds.0.node.attributes.ml\\.machine_memory/]