get-datafeed-stats.asciidoc 2.5 KB

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