get-transform-stats.asciidoc 9.0 KB

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