get-transform-stats.asciidoc 8.9 KB

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