get-transform-stats.asciidoc 4.7 KB

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