get-transform-stats.asciidoc 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[get-transform-stats]]
  4. === Get {transform} statistics API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {transform} statistics</titleabbrev>
  8. ++++
  9. Retrieves usage information for {transforms}.
  10. beta[]
  11. [[get-transform-stats-request]]
  12. ==== {api-request-title}
  13. `GET _transform/<transform_id>/_stats`
  14. `GET _transform/<transform_id>,<transform_id>/_stats` +
  15. `GET _transform/_stats` +
  16. `GET _transform/_all/_stats` +
  17. `GET _transform/*/_stats` +
  18. [[get-transform-stats-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have `monitor_transform`
  21. cluster privileges to use this API. The built-in `transform_user` role has these
  22. privileges. For more information, see <<security-privileges>> and
  23. <<built-in-roles>>.
  24. [[get-transform-stats-desc]]
  25. ==== {api-description-title}
  26. You can get statistics for multiple {transforms} in a single API
  27. request by using a comma-separated list of identifiers or a wildcard expression.
  28. You can get statistics for all {transforms} by using `_all`, by
  29. specifying `*` as the `<transform_id>`, or by omitting the
  30. `<transform_id>`.
  31. [[get-transform-stats-path-parms]]
  32. ==== {api-path-parms-title}
  33. `<transform_id>`::
  34. (Optional, string)
  35. include::{docdir}/rest-api/common-parms.asciidoc[tag=transform-id-wildcard]
  36. [[get-transform-stats-query-parms]]
  37. ==== {api-query-parms-title}
  38. `allow_no_match`::
  39. (Optional, boolean)
  40. include::{docdir}/rest-api/common-parms.asciidoc[tag=allow-no-match-transforms1]
  41. `from`::
  42. (Optional, integer)
  43. include::{docdir}/rest-api/common-parms.asciidoc[tag=from-transforms]
  44. `size`::
  45. (Optional, integer)
  46. include::{docdir}/rest-api/common-parms.asciidoc[tag=size-transforms]
  47. [[get-transform-stats-response]]
  48. ==== {api-response-body-title}
  49. `transforms`::
  50. (array) An array of statistics objects for {transforms}, which are
  51. sorted by the `id` value in ascending order.
  52. [[get-transform-stats-response-codes]]
  53. ==== {api-response-codes-title}
  54. `404` (Missing resources)::
  55. If `allow_no_match` is `false`, this code indicates that there are no
  56. resources that match the request or only partial matches for the request.
  57. [[get-transform-stats-example]]
  58. ==== Examples
  59. The following example skips for the first five {transforms} and
  60. gets usage information for a maximum of ten results:
  61. [source,console]
  62. --------------------------------------------------
  63. GET _transform/_stats?from=5&size=10
  64. --------------------------------------------------
  65. // TEST[skip:todo]
  66. The following example gets usage information for the `ecommerce_transform`
  67. {transform}:
  68. [source,console]
  69. --------------------------------------------------
  70. GET _transform/ecommerce_transform/_stats
  71. --------------------------------------------------
  72. // TEST[skip:todo]
  73. The API returns the following results:
  74. [source,console-result]
  75. ----
  76. {
  77. "count" : 1,
  78. "transforms" : [
  79. {
  80. "id" : "ecommerce_transform",
  81. "state" : "indexing",
  82. "stats" : {
  83. "pages_processed" : 2,
  84. "documents_processed" : 1220,
  85. "documents_indexed" : 13,
  86. "trigger_count" : 1,
  87. "index_time_in_ms" : 19,
  88. "index_total" : 1,
  89. "index_failures" : 0,
  90. "search_time_in_ms" : 52,
  91. "search_total" : 2,
  92. "search_failures" : 0,
  93. "exponential_avg_checkpoint_duration_ms" : 77,
  94. "exponential_avg_documents_indexed" : 2,
  95. "exponential_avg_documents_processed" : 12
  96. },
  97. "checkpointing" : {
  98. "last" : {
  99. "checkpoint" : 100,
  100. "timestamp_millis" : 1561740252497,
  101. "time_upper_bound_millis" : 1561740192497
  102. },
  103. "next" : {
  104. "checkpoint" : 101,
  105. "position" : {
  106. "indexer_position" : {
  107. "hashtag" : "abcd1234"
  108. },
  109. "buckets_position" : {
  110. "hashtag" : "abcd5678"
  111. }
  112. },
  113. "checkpoint_progress" : {
  114. "documents_processed": 100,
  115. "documents_indexed": 1
  116. },
  117. "changes_last_detected_at": 1561740629170,
  118. "timestamp_millis" : 1561740629172,
  119. "time_upper_bound_millis" : 1561740569172
  120. },
  121. "operations_behind": 27000
  122. }
  123. }
  124. ]
  125. }
  126. ----