get-transform-stats.asciidoc 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. [role="xpack"]
  2. [testenv="basic"]
  3. [[get-data-frame-transform-stats]]
  4. === Get {dataframe-transform} statistics API
  5. [subs="attributes"]
  6. ++++
  7. <titleabbrev>Get {dataframe-transform} statistics</titleabbrev>
  8. ++++
  9. Retrieves usage information for {dataframe-transforms}.
  10. beta[]
  11. [[get-data-frame-transform-stats-request]]
  12. ==== {api-request-title}
  13. `GET _data_frame/transforms/<data_frame_transform_id>/_stats`
  14. `GET _data_frame/transforms/<data_frame_transform_id>,<data_frame_transform_id>/_stats` +
  15. `GET _data_frame/transforms/_stats` +
  16. `GET _data_frame/transforms/_all/_stats` +
  17. `GET _data_frame/transforms/*/_stats` +
  18. [[get-data-frame-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 {stack-ov}/security-privileges.html[Security privileges] and
  24. {stack-ov}/built-in-roles.html[Built-in roles].
  25. [[get-data-frame-transform-stats-desc]]
  26. ==== {api-description-title}
  27. You can get statistics for multiple {dataframe-transforms} in a single API
  28. request by using a comma-separated list of identifiers or a wildcard expression.
  29. You can get statistics for all {dataframe-transforms} by using `_all`, by
  30. specifying `*` as the `<data_frame_transform_id>`, or by omitting the
  31. `<data_frame_transform_id>`.
  32. [[get-data-frame-transform-stats-path-parms]]
  33. ==== {api-path-parms-title}
  34. `<data_frame_transform_id>`::
  35. (Optional, string) Identifier for the {dataframe-transform}. It can be a
  36. {dataframe-transform} identifier or a wildcard expression. If you do not
  37. specify one of these options, the API returns information for all
  38. {dataframe-transforms}.
  39. [[get-data-frame-transform-stats-query-parms]]
  40. ==== {api-query-parms-title}
  41. `allow_no_match`::
  42. (Optional, boolean) Specifies what to do when the request:
  43. +
  44. --
  45. * Contains wildcard expressions and there are no {dataframe-transforms} that match.
  46. * Contains the `_all` string or no identifiers and there are no matches.
  47. * Contains wildcard expressions and there are only partial matches.
  48. The default value is `true`, which returns an empty `transforms` array when
  49. there are no matches and the subset of results when there are partial matches.
  50. If this parameter is `false`, the request returns a `404` status code when there
  51. are no matches or only partial matches.
  52. --
  53. `from`::
  54. (Optional, integer) Skips the specified number of {dataframe-transforms}. The
  55. default value is `0`.
  56. `size`::
  57. (Optional, integer) Specifies the maximum number of {dataframe-transforms} to obtain. The default value is `100`.
  58. [[get-data-frame-transform-stats-response]]
  59. ==== {api-response-body-title}
  60. `transforms`::
  61. (array) An array of statistics objects for {dataframe-transforms}, which are
  62. sorted by the `id` value in ascending order.
  63. [[get-data-frame-transform-stats-response-codes]]
  64. ==== {api-response-codes-title}
  65. `404` (Missing resources)::
  66. If `allow_no_match` is `false`, this code indicates that there are no
  67. resources that match the request or only partial matches for the request.
  68. [[get-data-frame-transform-stats-example]]
  69. ==== Examples
  70. The following example skips for the first five {dataframe-transforms} and
  71. gets usage information for a maximum of ten results:
  72. [source,js]
  73. --------------------------------------------------
  74. GET _data_frame/transforms/_stats?from=5&size=10
  75. --------------------------------------------------
  76. // CONSOLE
  77. // TEST[skip:todo]
  78. The following example gets usage information for the `ecommerce_transform`
  79. {dataframe-transform}:
  80. [source,js]
  81. --------------------------------------------------
  82. GET _data_frame/transforms/ecommerce_transform/_stats
  83. --------------------------------------------------
  84. // CONSOLE
  85. // TEST[skip:todo]
  86. The API returns the following results:
  87. [source,console-result]
  88. ----
  89. {
  90. "count" : 1,
  91. "transforms" : [
  92. {
  93. "id" : "ecommerce_transform",
  94. "state" : "indexing",
  95. "stats" : {
  96. "pages_processed" : 2,
  97. "documents_processed" : 1220,
  98. "documents_indexed" : 13,
  99. "trigger_count" : 1,
  100. "index_time_in_ms" : 19,
  101. "index_total" : 1,
  102. "index_failures" : 0,
  103. "search_time_in_ms" : 52,
  104. "search_total" : 2,
  105. "search_failures" : 0,
  106. "exponential_avg_checkpoint_duration_ms" : 77,
  107. "exponential_avg_documents_indexed" : 2,
  108. "exponential_avg_documents_processed" : 12
  109. },
  110. "checkpointing" : {
  111. "last" : {
  112. "checkpoint" : 100,
  113. "timestamp_millis" : 1561740252497,
  114. "time_upper_bound_millis" : 1561740192497
  115. },
  116. "next" : {
  117. "checkpoint" : 101,
  118. "position" : {
  119. "indexer_position" : {
  120. "hashtag" : "abcd1234"
  121. },
  122. "buckets_position" : {
  123. "hashtag" : "abcd5678"
  124. }
  125. },
  126. "checkpoint_progress" : {
  127. "documents_processed": 100,
  128. "documents_indexed": 1
  129. },
  130. "changes_last_detected_at": 1561740629170,
  131. "timestamp_millis" : 1561740629172,
  132. "time_upper_bound_millis" : 1561740569172
  133. },
  134. "operations_behind": 27000
  135. }
  136. }
  137. ]
  138. }
  139. ----