get-transform-stats.asciidoc 8.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261
  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. The API returns an array of statistics objects for {transforms}, which are
  49. sorted by the `id` value in ascending order. All of these properties are
  50. informational; you cannot update their values.
  51. `checkpointing`::
  52. (object) Contains statistics about <<transform-checkpoints,checkpoints>>.
  53. `checkpointing`.`changes_last_detected_at`:::
  54. (date)
  55. include::{docdir}/rest-api/common-parms.asciidoc[tag=checkpointing-changes-last-detected-at]
  56. `checkpointing`.`last`:::
  57. (object) Contains statistics about the last completed checkpoint.
  58. `checkpointing`.`last`.`checkpoint`::::
  59. (integer) The sequence number for the checkpoint.
  60. `checkpointing`.`last`.`time_upper_bound_millis`::::
  61. (date) When using time-based synchronization, this timestamp indicates the
  62. upper bound of data that is included in the checkpoint.
  63. `checkpointing`.`last`.`timestamp_millis`::::
  64. (date) The timestamp of the checkpoint, which indicates when the checkpoint
  65. was created.
  66. `checkpointing`.`next`:::
  67. (object) Contains statistics about the next checkpoint that is currently in
  68. progress. This object appears only when the {transform} `state` is `indexing`.
  69. `checkpointing`.`next`.`checkpoint`::::
  70. (integer) The sequence number for the checkpoint.
  71. `checkpointing`.`next`.`checkpoint_progress`::::
  72. (object) Contains statistics about the progress of the checkpoint. For example,
  73. it lists the `total_docs`, `docs_remaining`, `percent_complete`,
  74. `docs_processed`, and `docs_indexed`. This information is available only for
  75. batch {transforms} and the first checkpoint of {ctransforms}.
  76. `checkpointing`.`next`.`time_upper_bound_millis`::::
  77. (date) When using time-based synchronization, this timestamp indicates the
  78. upper bound of data that is included in the checkpoint.
  79. `checkpointing`.`next`.`timestamp_millis`::::
  80. (date) The timestamp of the checkpoint, which indicates when the checkpoint was
  81. created.
  82. `checkpointing`.`operations_behind`:::
  83. (integer) The number of operations that have occurred on the source index but
  84. have not been applied to the destination index yet. A high number can indicate
  85. that the {transform} is failing to keep up.
  86. `id`::
  87. (string)
  88. include::{docdir}/rest-api/common-parms.asciidoc[tag=transform-id]
  89. `node`::
  90. (object) For started {transforms} only, the node upon which the {transform} is
  91. started.
  92. `node`.`attributes`:::
  93. (object) A list of attributes for the node.
  94. `node`.`ephemeral_id`:::
  95. (string) The node ephemeral ID.
  96. `node`.`id`:::
  97. (string) The unique identifier of the node. For example, "0-o0tOoRTwKFZifatTWKNw".
  98. `node`.`name`:::
  99. (string) The node name. For example, `0-o0tOo`.
  100. `node`.`transport_address`:::
  101. (string) The host and port where transport HTTP connections are accepted. For
  102. example, `127.0.0.1:9300`.
  103. `reason`::
  104. (string)
  105. include::{docdir}/rest-api/common-parms.asciidoc[tag=state-transform-reason]
  106. `state`::
  107. (string)
  108. include::{docdir}/rest-api/common-parms.asciidoc[tag=state-transform]
  109. `stats`::
  110. (object) An object that provides statistical information about the {transform}.
  111. `stats`.`documents_indexed`:::
  112. (long)
  113. include::{docdir}/rest-api/common-parms.asciidoc[tag=docs-indexed]
  114. `stats`.`documents_processed`:::
  115. (long)
  116. include::{docdir}/rest-api/common-parms.asciidoc[tag=docs-processed]
  117. `stats`.`exponential_avg_checkpoint_duration_ms`:::
  118. (double)
  119. include::{docdir}/rest-api/common-parms.asciidoc[tag=exponential-avg-checkpoint-duration-ms]
  120. `stats`.`exponential_avg_documents_indexed`:::
  121. (double)
  122. include::{docdir}/rest-api/common-parms.asciidoc[tag=exponential-avg-documents-indexed]
  123. `stats`.`exponential_avg_documents_processed`:::
  124. (double)
  125. include::{docdir}/rest-api/common-parms.asciidoc[tag=exponential-avg-documents-processed]
  126. `stats`.`index_failures`:::
  127. (long)
  128. include::{docdir}/rest-api/common-parms.asciidoc[tag=index-failures]
  129. `stats`.`index_time_in_ms`:::
  130. (long)
  131. include::{docdir}/rest-api/common-parms.asciidoc[tag=index-time-ms]
  132. `stats`.`index_total`:::
  133. (long)
  134. include::{docdir}/rest-api/common-parms.asciidoc[tag=index-total]
  135. `stats`.`pages_processed`:::
  136. (long)
  137. include::{docdir}/rest-api/common-parms.asciidoc[tag=pages-processed]
  138. `stats`.`search_failures`:::
  139. (long)
  140. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-failures]
  141. `stats`.`search_time_in_ms`:::
  142. (long)
  143. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-time-ms]
  144. `stats`.`search_total`:::
  145. (long)
  146. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-total]
  147. `stats`.`trigger_count`:::
  148. (long)
  149. include::{docdir}/rest-api/common-parms.asciidoc[tag=trigger-count]
  150. [[get-transform-stats-response-codes]]
  151. ==== {api-response-codes-title}
  152. `404` (Missing resources)::
  153. If `allow_no_match` is `false`, this code indicates that there are no
  154. resources that match the request or only partial matches for the request.
  155. [[get-transform-stats-example]]
  156. ==== Examples
  157. The following example skips for the first five {transforms} and
  158. gets usage information for a maximum of ten results:
  159. [source,console]
  160. --------------------------------------------------
  161. GET _transform/_stats?from=5&size=10
  162. --------------------------------------------------
  163. // TEST[skip:todo]
  164. The following example gets usage information for the `ecommerce_transform`
  165. {transform}:
  166. [source,console]
  167. --------------------------------------------------
  168. GET _transform/ecommerce_transform/_stats
  169. --------------------------------------------------
  170. // TEST[skip:todo]
  171. The API returns the following results:
  172. [source,console-result]
  173. ----
  174. {
  175. "count" : 1,
  176. "transforms" : [
  177. {
  178. "id" : "ecommerce_transform",
  179. "state" : "indexing",
  180. "stats" : {
  181. "pages_processed" : 2,
  182. "documents_processed" : 1220,
  183. "documents_indexed" : 13,
  184. "trigger_count" : 1,
  185. "index_time_in_ms" : 19,
  186. "index_total" : 1,
  187. "index_failures" : 0,
  188. "search_time_in_ms" : 52,
  189. "search_total" : 2,
  190. "search_failures" : 0,
  191. "exponential_avg_checkpoint_duration_ms" : 77,
  192. "exponential_avg_documents_indexed" : 2,
  193. "exponential_avg_documents_processed" : 12
  194. },
  195. "checkpointing" : {
  196. "last" : {
  197. "checkpoint" : 100,
  198. "timestamp_millis" : 1561740252497,
  199. "time_upper_bound_millis" : 1561740192497
  200. },
  201. "next" : {
  202. "checkpoint" : 101,
  203. "position" : {
  204. "indexer_position" : {
  205. "hashtag" : "abcd1234"
  206. },
  207. "buckets_position" : {
  208. "hashtag" : "abcd5678"
  209. }
  210. },
  211. "checkpoint_progress" : {
  212. "documents_processed": 100,
  213. "documents_indexed": 1
  214. },
  215. "changes_last_detected_at": 1561740629170,
  216. "timestamp_millis" : 1561740629172,
  217. "time_upper_bound_millis" : 1561740569172
  218. },
  219. "operations_behind": 27000
  220. }
  221. }
  222. ]
  223. }
  224. ----