get-transform-stats.asciidoc 8.5 KB

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