get-transform-stats.asciidoc 4.1 KB

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