get-transform-stats.asciidoc 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  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. `search_failures`:::
  173. (long)
  174. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-failures]
  175. `search_time_in_ms`:::
  176. (long)
  177. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-time-ms]
  178. `search_total`:::
  179. (long)
  180. include::{docdir}/rest-api/common-parms.asciidoc[tag=search-total]
  181. `trigger_count`:::
  182. (long)
  183. include::{docdir}/rest-api/common-parms.asciidoc[tag=trigger-count]
  184. ====
  185. //End stats
  186. [[get-transform-stats-response-codes]]
  187. ==== {api-response-codes-title}
  188. `404` (Missing resources)::
  189. If `allow_no_match` is `false`, this code indicates that there are no
  190. resources that match the request or only partial matches for the request.
  191. [[get-transform-stats-example]]
  192. ==== Examples
  193. The following example skips for the first five {transforms} and
  194. gets usage information for a maximum of ten results:
  195. [source,console]
  196. --------------------------------------------------
  197. GET _transform/_stats?from=5&size=10
  198. --------------------------------------------------
  199. // TEST[skip:todo]
  200. The following example gets usage information for the `ecommerce_transform`
  201. {transform}:
  202. [source,console]
  203. --------------------------------------------------
  204. GET _transform/ecommerce_transform/_stats
  205. --------------------------------------------------
  206. // TEST[skip:todo]
  207. The API returns the following results:
  208. [source,console-result]
  209. ----
  210. {
  211. "count" : 1,
  212. "transforms" : [
  213. {
  214. "id" : "ecommerce_transform",
  215. "state" : "indexing",
  216. "stats" : {
  217. "pages_processed" : 2,
  218. "documents_processed" : 1220,
  219. "documents_indexed" : 13,
  220. "trigger_count" : 1,
  221. "index_time_in_ms" : 19,
  222. "index_total" : 1,
  223. "index_failures" : 0,
  224. "search_time_in_ms" : 52,
  225. "search_total" : 2,
  226. "search_failures" : 0,
  227. "exponential_avg_checkpoint_duration_ms" : 77,
  228. "exponential_avg_documents_indexed" : 2,
  229. "exponential_avg_documents_processed" : 12
  230. },
  231. "checkpointing" : {
  232. "last" : {
  233. "checkpoint" : 100,
  234. "timestamp_millis" : 1561740252497,
  235. "time_upper_bound_millis" : 1561740192497
  236. },
  237. "next" : {
  238. "checkpoint" : 101,
  239. "position" : {
  240. "indexer_position" : {
  241. "hashtag" : "abcd1234"
  242. },
  243. "buckets_position" : {
  244. "hashtag" : "abcd5678"
  245. }
  246. },
  247. "checkpoint_progress" : {
  248. "documents_processed": 100,
  249. "documents_indexed": 1
  250. },
  251. "changes_last_detected_at": 1561740629170,
  252. "timestamp_millis" : 1561740629172,
  253. "time_upper_bound_millis" : 1561740569172
  254. },
  255. "operations_behind": 27000
  256. }
  257. }
  258. ]
  259. }
  260. ----