get-job-stats.asciidoc 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. [role="xpack"]
  2. [testenv="platinum"]
  3. [[ml-get-job-stats]]
  4. === Get Job Statistics API
  5. ++++
  6. <titleabbrev>Get Job Statistics</titleabbrev>
  7. ++++
  8. Retrieves usage information for jobs.
  9. ==== Request
  10. `GET _xpack/ml/anomaly_detectors/<job_id>/_stats`
  11. `GET _xpack/ml/anomaly_detectors/<job_id>,<job_id>/_stats` +
  12. `GET _xpack/ml/anomaly_detectors/_stats` +
  13. `GET _xpack/ml/anomaly_detectors/_all/_stats` +
  14. ===== Description
  15. You can get statistics for multiple jobs in a single API request by using a
  16. group name, a comma-separated list of jobs, or a wildcard expression. You can
  17. get statistics for all jobs by using `_all`, by specifying `*` as the
  18. `<job_id>`, or by omitting the `<job_id>`.
  19. ==== Path Parameters
  20. `job_id`::
  21. (string) An identifier for the job. It can be a job identifier, a group name,
  22. or a wildcard expression. If you do not specify one of these options, the API
  23. returns statistics for all jobs.
  24. ==== Results
  25. The API returns the following information:
  26. `jobs`::
  27. (array) An array of job statistics objects.
  28. For more information, see <<ml-jobstats,Job Statistics>>.
  29. ==== Authorization
  30. You must have `monitor_ml`, `monitor`, `manage_ml`, or `manage` cluster
  31. privileges to use this API. For more information, see
  32. {xpack-ref}/security-privileges.html[Security Privileges].
  33. ==== Examples
  34. The following example gets usage information for the `farequote` job:
  35. [source,js]
  36. --------------------------------------------------
  37. GET _xpack/ml/anomaly_detectors/farequote/_stats
  38. --------------------------------------------------
  39. // CONSOLE
  40. // TEST[skip:todo]
  41. The API returns the following results:
  42. [source,js]
  43. ----
  44. {
  45. "count": 1,
  46. "jobs": [
  47. {
  48. "job_id": "farequote",
  49. "data_counts": {
  50. "job_id": "farequote",
  51. "processed_record_count": 86275,
  52. "processed_field_count": 172550,
  53. "input_bytes": 6744714,
  54. "input_field_count": 172550,
  55. "invalid_date_count": 0,
  56. "missing_field_count": 0,
  57. "out_of_order_timestamp_count": 0,
  58. "empty_bucket_count": 0,
  59. "sparse_bucket_count": 15,
  60. "bucket_count": 1528,
  61. "earliest_record_timestamp": 1454803200000,
  62. "latest_record_timestamp": 1455235196000,
  63. "last_data_time": 1491948163685,
  64. "latest_sparse_bucket_timestamp": 1455174900000,
  65. "input_record_count": 86275
  66. },
  67. "model_size_stats": {
  68. "job_id": "farequote",
  69. "result_type": "model_size_stats",
  70. "model_bytes": 387594,
  71. "total_by_field_count": 21,
  72. "total_over_field_count": 0,
  73. "total_partition_field_count": 20,
  74. "bucket_allocation_failures_count": 0,
  75. "memory_status": "ok",
  76. "log_time": 1491948163000,
  77. "timestamp": 1455234600000
  78. },
  79. "state": "closed"
  80. }
  81. ]
  82. }
  83. ----