get-transform-stats.asciidoc 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  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. beta[]
  11. [[get-transform-stats-request]]
  12. ==== {api-request-title}
  13. `GET _transform/<transform_id>/_stats`
  14. `GET _transform/<transform_id>,<transform_id>/_stats` +
  15. `GET _transform/_stats` +
  16. `GET _transform/_all/_stats` +
  17. `GET _transform/*/_stats` +
  18. [[get-transform-stats-prereqs]]
  19. ==== {api-prereq-title}
  20. * If the {es} {security-features} are enabled, you must have
  21. `monitor_data_frame_transforms` cluster privileges to use this API. The built-in
  22. `data_frame_transforms_user` role has these privileges. For more information,
  23. 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) Identifier for the {transform}. It can be a
  35. {transform} identifier or a wildcard expression. If you do not
  36. specify one of these options, the API returns information for all
  37. {transforms}.
  38. [[get-transform-stats-query-parms]]
  39. ==== {api-query-parms-title}
  40. `allow_no_match`::
  41. (Optional, boolean) Specifies what to do when the request:
  42. +
  43. --
  44. * Contains wildcard expressions and there are no {transforms} that match.
  45. * Contains the `_all` string or no identifiers and there are no matches.
  46. * Contains wildcard expressions and there are only partial matches.
  47. The default value is `true`, which returns an empty `transforms` array when
  48. there are no matches and the subset of results when there are partial matches.
  49. If this parameter is `false`, the request returns a `404` status code when there
  50. are no matches or only partial matches.
  51. --
  52. `from`::
  53. (Optional, integer) Skips the specified number of {transforms}. The
  54. default value is `0`.
  55. `size`::
  56. (Optional, integer) Specifies the maximum number of {transforms} to obtain. The default value is `100`.
  57. [[get-transform-stats-response]]
  58. ==== {api-response-body-title}
  59. `transforms`::
  60. (array) An array of statistics objects for {transforms}, which are
  61. sorted by the `id` value in ascending order.
  62. [[get-transform-stats-response-codes]]
  63. ==== {api-response-codes-title}
  64. `404` (Missing resources)::
  65. If `allow_no_match` is `false`, this code indicates that there are no
  66. resources that match the request or only partial matches for the request.
  67. [[get-transform-stats-example]]
  68. ==== Examples
  69. The following example skips for the first five {transforms} and
  70. gets usage information for a maximum of ten results:
  71. [source,console]
  72. --------------------------------------------------
  73. GET _transform/_stats?from=5&size=10
  74. --------------------------------------------------
  75. // TEST[skip:todo]
  76. The following example gets usage information for the `ecommerce_transform`
  77. {transform}:
  78. [source,console]
  79. --------------------------------------------------
  80. GET _transform/ecommerce_transform/_stats
  81. --------------------------------------------------
  82. // TEST[skip:todo]
  83. The API returns the following results:
  84. [source,console-result]
  85. ----
  86. {
  87. "count" : 1,
  88. "transforms" : [
  89. {
  90. "id" : "ecommerce_transform",
  91. "state" : "indexing",
  92. "stats" : {
  93. "pages_processed" : 2,
  94. "documents_processed" : 1220,
  95. "documents_indexed" : 13,
  96. "trigger_count" : 1,
  97. "index_time_in_ms" : 19,
  98. "index_total" : 1,
  99. "index_failures" : 0,
  100. "search_time_in_ms" : 52,
  101. "search_total" : 2,
  102. "search_failures" : 0,
  103. "exponential_avg_checkpoint_duration_ms" : 77,
  104. "exponential_avg_documents_indexed" : 2,
  105. "exponential_avg_documents_processed" : 12
  106. },
  107. "checkpointing" : {
  108. "last" : {
  109. "checkpoint" : 100,
  110. "timestamp_millis" : 1561740252497,
  111. "time_upper_bound_millis" : 1561740192497
  112. },
  113. "next" : {
  114. "checkpoint" : 101,
  115. "position" : {
  116. "indexer_position" : {
  117. "hashtag" : "abcd1234"
  118. },
  119. "buckets_position" : {
  120. "hashtag" : "abcd5678"
  121. }
  122. },
  123. "checkpoint_progress" : {
  124. "documents_processed": 100,
  125. "documents_indexed": 1
  126. },
  127. "changes_last_detected_at": 1561740629170,
  128. "timestamp_millis" : 1561740629172,
  129. "time_upper_bound_millis" : 1561740569172
  130. },
  131. "operations_behind": 27000
  132. }
  133. }
  134. ]
  135. }
  136. ----