enrich-stats.asciidoc 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. [role="xpack"]
  2. [[enrich-stats-api]]
  3. === Enrich stats API
  4. ++++
  5. <titleabbrev>Enrich stats</titleabbrev>
  6. ++++
  7. Returns <<coordinating-node,enrich coordinator>> statistics
  8. and information about <<enrich-policy,enrich policies>>
  9. that are currently executing.
  10. [source,console]
  11. ----
  12. GET /_enrich/_stats
  13. ----
  14. [[enrich-stats-api-request]]
  15. ==== {api-request-title}
  16. `GET /_enrich/_stats`
  17. [[enrich-stats-api-response-body]]
  18. ==== {api-response-body-title}
  19. `executing_policies`::
  20. +
  21. --
  22. (Array of objects)
  23. Objects containing information
  24. about each enrich policy
  25. that is currently executing.
  26. Returned parameters include:
  27. `name`::
  28. (String)
  29. Name of the enrich policy.
  30. `task`::
  31. (<<tasks,Task object>>)
  32. Object containing detailed information
  33. about the policy execution task.
  34. --
  35. `coordinator_stats`::
  36. +
  37. --
  38. (Array of objects)
  39. Objects containing information
  40. about each <<coordinating-node,coordinating ingest node>>
  41. for configured enrich processors.
  42. Returned parameters include:
  43. `node_id`::
  44. (String)
  45. ID of the ingest node coordinating search requests
  46. for configured enrich processors.
  47. `queue_size`::
  48. (Integer)
  49. Number of search requests in the queue.
  50. `remote_requests_current`::
  51. (Integer)
  52. Current number of outstanding remote requests.
  53. `remote_requests_total`::
  54. (Integer)
  55. Number of outstanding remote requests executed
  56. since node startup.
  57. +
  58. In most cases,
  59. a remote request includes multiple search requests.
  60. This depends on the number of search requests in the queue
  61. when the remote request is executed.
  62. `executed_searches_total`::
  63. (Integer)
  64. Number of search requests
  65. that enrich processors have executed
  66. since node startup.
  67. --
  68. `cache_stats`::
  69. +
  70. --
  71. (Array of objects)
  72. Objects containing information about the enrich
  73. cache stats on each ingest node.
  74. Returned parameters include:
  75. `node_id`::
  76. (String)
  77. ID of the ingest node with a enrich cache.
  78. `count`::
  79. (Integer)
  80. Number of cached entries.
  81. `hits`::
  82. (Integer)
  83. The number of enrich lookups served from cache.
  84. `misses`::
  85. (Integer)
  86. The number of time enrich lookups couldn't be
  87. served from cache.
  88. `evictions`::
  89. (Integer)
  90. The number cache entries evicted from the cache.
  91. `hits_time_in_millis`::
  92. (Long)
  93. The amount of time in milliseconds spent fetching data from the cache on successful cache hits only.
  94. `misses_time_in_millis`::
  95. (Long)
  96. The amount of time in milliseconds spent fetching data from the enrich index and updating the cache, on cache misses only.
  97. `size_in_bytes`::
  98. (Long)
  99. An _approximation_ of the size in bytes that the enrich cache takes up on the heap.
  100. --
  101. [[enrich-stats-api-example]]
  102. ==== {api-examples-title}
  103. [source,console]
  104. ----
  105. GET /_enrich/_stats
  106. ----
  107. //TEST[s/^/PUT \/_enrich\/policy\/my-policy\/_execute\/n/\
  108. The API returns the following response:
  109. [source,console-result]
  110. ----
  111. {
  112. "executing_policies": [
  113. {
  114. "name": "my-policy",
  115. "task": {
  116. "id": 124,
  117. "type": "direct",
  118. "action": "cluster:admin/xpack/enrich/execute",
  119. "start_time_in_millis": 1458585884904,
  120. "running_time_in_nanos": 47402,
  121. "cancellable": false,
  122. "parent_task_id": "oTUltX4IQMOUUVeiohTt8A:123",
  123. "headers": {
  124. "X-Opaque-Id": "123456"
  125. }
  126. }
  127. }
  128. ],
  129. "coordinator_stats": [
  130. {
  131. "node_id": "1sFM8cmSROZYhPxVsiWew",
  132. "queue_size": 0,
  133. "remote_requests_current": 0,
  134. "remote_requests_total": 0,
  135. "executed_searches_total": 0
  136. }
  137. ],
  138. "cache_stats": [
  139. {
  140. "node_id": "1sFM8cmSROZYhPxVsiWew",
  141. "count": 0,
  142. "hits": 0,
  143. "misses": 0,
  144. "evictions": 0,
  145. "hits_time_in_millis": 0,
  146. "misses_time_in_millis": 0,
  147. "size_in_bytes": 0
  148. }
  149. ]
  150. }
  151. ----
  152. // TESTRESPONSE[s/"executing_policies": \[[^\]]*\]/"executing_policies": $body.$_path/]
  153. // TESTRESPONSE[s/"node_id": "1sFM8cmSROZYhPxVsiWew"/"node_id" : $body.coordinator_stats.0.node_id/]
  154. // TESTRESPONSE[s/"remote_requests_total": 0/"remote_requests_total" : $body.coordinator_stats.0.remote_requests_total/]
  155. // TESTRESPONSE[s/"executed_searches_total": 0/"executed_searches_total" : $body.coordinator_stats.0.executed_searches_total/]
  156. // TESTRESPONSE[s/"node_id": "1sFM8cmSROZYhPxVsiWew"/"node_id" : $body.cache_stats.0.node_id/]
  157. // TESTRESPONSE[s/"count": 0/"count" : $body.cache_stats.0.count/]
  158. // TESTRESPONSE[s/"misses": 0/"misses" : $body.cache_stats.0.misses/]
  159. // TESTRESPONSE[s/"evictions": 0/"evictions" : $body.cache_stats.0.evictions/]
  160. // TESTRESPONSE[s/"hits_time_in_millis": 0/"hits_time_in_millis" : $body.cache_stats.0.hits_time_in_millis/]
  161. // TESTRESPONSE[s/"misses_time_in_millis": 0/"misses_time_in_millis" : $body.cache_stats.0.misses_time_in_millis/]
  162. // TESTRESPONSE[s/"size_in_bytes": 0/"size_in_bytes" : $body.cache_stats.0.size_in_bytes/]