get-transform-stats.asciidoc 8.5 KB

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