get-transform-stats.asciidoc 9.0 KB

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