get-transform-stats.asciidoc 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  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. //Begin health
  111. `health`::
  112. (object) Health indicator for this {transform}.
  113. +
  114. .Properties of `health`
  115. [%collapsible%open]
  116. ====
  117. `status`::
  118. (string) Health status of this transform. Statuses are:
  119. * `green`:
  120. The transform is healthy.
  121. * `unknown`:
  122. The health of the transform could not be determined.
  123. * `yellow`:
  124. The functionality of the transform is in a degraded state and may need
  125. remediation to avoid the health becoming `red`.
  126. * `red`:
  127. The transform is experiencing an outage or is unavailable for use.
  128. `issues`::
  129. (Optional, array) If a non-healthy status is returned, contains a list of issues
  130. of the transform.
  131. +
  132. .Properties of `issues`
  133. [%collapsible%open]
  134. ========
  135. `issue`::
  136. (string) A description of the issue.
  137. `details`::
  138. (Optional, string) Details about the issue.
  139. `count`::
  140. (integer) Number of times the issue has occured since it started.
  141. `first_occurrence`::
  142. (Optional, date) The timestamp this issue occured for the first time.
  143. ========
  144. //End issues
  145. ====
  146. //End health
  147. `id`::
  148. (string)
  149. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=transform-id]
  150. //Begin node
  151. `node`::
  152. (object) For started {transforms} only, the node upon which the {transform} is
  153. started.
  154. +
  155. .Properties of `node`
  156. [%collapsible%open]
  157. ====
  158. `attributes`:::
  159. (object) A list of attributes for the node.
  160. `ephemeral_id`:::
  161. (string) The node ephemeral ID.
  162. `id`:::
  163. (string) The unique identifier of the node. For example, "0-o0tOoRTwKFZifatTWKNw".
  164. `name`:::
  165. (string) The node name. For example, `0-o0tOo`.
  166. `transport_address`:::
  167. (string) The host and port where transport HTTP connections are accepted. For
  168. example, `127.0.0.1:9300`.
  169. ====
  170. //End node
  171. `reason`::
  172. (string)
  173. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=state-transform-reason]
  174. `state`::
  175. (string)
  176. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=state-transform]
  177. //Begin stats
  178. `stats`::
  179. (object) An object that provides statistical information about the {transform}.
  180. +
  181. .Properties of `stats`
  182. [%collapsible%open]
  183. ====
  184. `delete_time_in_ms`:::
  185. (long)
  186. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=delete-time-ms]
  187. `documents_deleted`:::
  188. (long)
  189. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-deleted-transform]
  190. `documents_indexed`:::
  191. (long)
  192. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-indexed]
  193. `documents_processed`:::
  194. (long)
  195. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=docs-processed]
  196. `exponential_avg_checkpoint_duration_ms`:::
  197. (double)
  198. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=exponential-avg-checkpoint-duration-ms]
  199. `exponential_avg_documents_indexed`:::
  200. (double)
  201. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=exponential-avg-documents-indexed]
  202. `exponential_avg_documents_processed`:::
  203. (double)
  204. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=exponential-avg-documents-processed]
  205. `index_failures`:::
  206. (long)
  207. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-failures]
  208. `index_time_in_ms`:::
  209. (long)
  210. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-time-ms]
  211. `index_total`:::
  212. (long)
  213. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=index-total]
  214. `pages_processed`:::
  215. (long)
  216. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=pages-processed]
  217. `processing_time_in_ms`:::
  218. (long)
  219. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=processing-time-ms]
  220. `processing_total`:::
  221. (long)
  222. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=processing-total]
  223. `search_failures`:::
  224. (long)
  225. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search-failures]
  226. `search_time_in_ms`:::
  227. (long)
  228. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search-time-ms]
  229. `search_total`:::
  230. (long)
  231. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=search-total]
  232. `trigger_count`:::
  233. (long)
  234. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=trigger-count]
  235. ====
  236. //End stats
  237. [[get-transform-stats-response-codes]]
  238. == {api-response-codes-title}
  239. `404` (Missing resources)::
  240. If `allow_no_match` is `false`, this code indicates that there are no
  241. resources that match the request or only partial matches for the request.
  242. [[get-transform-stats-example]]
  243. == Examples
  244. The following example skips for the first five {transforms} and
  245. gets usage information for a maximum of ten results:
  246. [source,console]
  247. --------------------------------------------------
  248. GET _transform/_stats?from=5&size=10
  249. --------------------------------------------------
  250. // TEST[skip:todo]
  251. The following example gets usage information for the {transform}:
  252. [source,console]
  253. --------------------------------------------------
  254. GET _transform/ecommerce-customer-transform/_stats
  255. --------------------------------------------------
  256. // TEST[skip:todo]
  257. The API returns the following results:
  258. [source,console-result]
  259. ----
  260. {
  261. "count" : 1,
  262. "transforms" : [
  263. {
  264. "id" : "ecommerce-customer-transform",
  265. "state" : "started",
  266. "node" : {
  267. "id" : "cpTIGMsVQ8Gqwqlxxxxxxx",
  268. "name" : "my.home",
  269. "ephemeral_id" : "5-L21nFsQxxxxxxxxxx-xx",
  270. "transport_address" : "127.0.0.1:9300",
  271. "attributes" : { }
  272. },
  273. "stats" : {
  274. "pages_processed" : 78,
  275. "documents_processed" : 6027,
  276. "documents_indexed" : 68,
  277. "documents_deleted": 22,
  278. "delete_time_in_ms": 214,
  279. "trigger_count" : 168,
  280. "index_time_in_ms" : 412,
  281. "index_total" : 20,
  282. "index_failures" : 0,
  283. "search_time_in_ms" : 353,
  284. "search_total" : 78,
  285. "search_failures" : 0,
  286. "processing_time_in_ms" : 8,
  287. "processing_total" : 78,
  288. "exponential_avg_checkpoint_duration_ms" : 97.30637923893185,
  289. "exponential_avg_documents_indexed" : 2.2064915040974062,
  290. "exponential_avg_documents_processed" : 179.89419945785045
  291. },
  292. "checkpointing" : {
  293. "last" : {
  294. "checkpoint" : 20,
  295. "timestamp_millis" : 1585344558220,
  296. "time_upper_bound_millis" : 1585344498220
  297. },
  298. "changes_last_detected_at" : 1585344558219
  299. },
  300. "health": {
  301. "status": "green"
  302. }
  303. }
  304. ]
  305. }
  306. ----