stats.asciidoc 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. [[cluster-stats]]
  2. == Cluster Stats
  3. The Cluster Stats API allows to retrieve statistics from a cluster wide perspective.
  4. The API returns basic index metrics (shard numbers, store size, memory usage) and
  5. information about the current nodes that form the cluster (number, roles, os, jvm
  6. versions, memory usage, cpu and installed plugins).
  7. [source,js]
  8. --------------------------------------------------
  9. GET /_cluster/stats?human&pretty
  10. --------------------------------------------------
  11. // CONSOLE
  12. // TEST[setup:twitter]
  13. Will return, for example:
  14. ["source","js",subs="attributes,callouts"]
  15. --------------------------------------------------
  16. {
  17. "_nodes" : {
  18. "total" : 1,
  19. "successful" : 1,
  20. "failed" : 0
  21. },
  22. "cluster_name": "elasticsearch",
  23. "timestamp": 1459427693515,
  24. "status": "green",
  25. "indices": {
  26. "count": 1,
  27. "shards": {
  28. "total": 5,
  29. "primaries": 5,
  30. "replication": 0,
  31. "index": {
  32. "shards": {
  33. "min": 5,
  34. "max": 5,
  35. "avg": 5
  36. },
  37. "primaries": {
  38. "min": 5,
  39. "max": 5,
  40. "avg": 5
  41. },
  42. "replication": {
  43. "min": 0,
  44. "max": 0,
  45. "avg": 0
  46. }
  47. }
  48. },
  49. "docs": {
  50. "count": 10,
  51. "deleted": 0
  52. },
  53. "store": {
  54. "size": "16.2kb",
  55. "size_in_bytes": 16684
  56. },
  57. "fielddata": {
  58. "memory_size": "0b",
  59. "memory_size_in_bytes": 0,
  60. "evictions": 0
  61. },
  62. "query_cache": {
  63. "memory_size": "0b",
  64. "memory_size_in_bytes": 0,
  65. "total_count": 0,
  66. "hit_count": 0,
  67. "miss_count": 0,
  68. "cache_size": 0,
  69. "cache_count": 0,
  70. "evictions": 0
  71. },
  72. "completion": {
  73. "size": "0b",
  74. "size_in_bytes": 0
  75. },
  76. "segments": {
  77. "count": 4,
  78. "memory": "8.6kb",
  79. "memory_in_bytes": 8898,
  80. "terms_memory": "6.3kb",
  81. "terms_memory_in_bytes": 6522,
  82. "stored_fields_memory": "1.2kb",
  83. "stored_fields_memory_in_bytes": 1248,
  84. "term_vectors_memory": "0b",
  85. "term_vectors_memory_in_bytes": 0,
  86. "norms_memory": "384b",
  87. "norms_memory_in_bytes": 384,
  88. "points_memory" : "0b",
  89. "points_memory_in_bytes" : 0,
  90. "doc_values_memory": "744b",
  91. "doc_values_memory_in_bytes": 744,
  92. "index_writer_memory": "0b",
  93. "index_writer_memory_in_bytes": 0,
  94. "version_map_memory": "0b",
  95. "version_map_memory_in_bytes": 0,
  96. "fixed_bit_set": "0b",
  97. "fixed_bit_set_memory_in_bytes": 0,
  98. "max_unsafe_auto_id_timestamp" : -9223372036854775808,
  99. "file_sizes": {}
  100. }
  101. },
  102. "nodes": {
  103. "count": {
  104. "total": 1,
  105. "data": 1,
  106. "coordinating_only": 0,
  107. "master": 1,
  108. "ingest": 1
  109. },
  110. "versions": [
  111. "{version}"
  112. ],
  113. "os": {
  114. "available_processors": 8,
  115. "allocated_processors": 8,
  116. "names": [
  117. {
  118. "name": "Mac OS X",
  119. "count": 1
  120. }
  121. ],
  122. "mem" : {
  123. "total" : "16gb",
  124. "total_in_bytes" : 17179869184,
  125. "free" : "78.1mb",
  126. "free_in_bytes" : 81960960,
  127. "used" : "15.9gb",
  128. "used_in_bytes" : 17097908224,
  129. "free_percent" : 0,
  130. "used_percent" : 100
  131. }
  132. },
  133. "process": {
  134. "cpu": {
  135. "percent": 9
  136. },
  137. "open_file_descriptors": {
  138. "min": 268,
  139. "max": 268,
  140. "avg": 268
  141. }
  142. },
  143. "jvm": {
  144. "max_uptime": "13.7s",
  145. "max_uptime_in_millis": 13737,
  146. "versions": [
  147. {
  148. "version": "1.8.0_74",
  149. "vm_name": "Java HotSpot(TM) 64-Bit Server VM",
  150. "vm_version": "25.74-b02",
  151. "vm_vendor": "Oracle Corporation",
  152. "count": 1
  153. }
  154. ],
  155. "mem": {
  156. "heap_used": "57.5mb",
  157. "heap_used_in_bytes": 60312664,
  158. "heap_max": "989.8mb",
  159. "heap_max_in_bytes": 1037959168
  160. },
  161. "threads": 90
  162. },
  163. "fs": {
  164. "total": "200.6gb",
  165. "total_in_bytes": 215429193728,
  166. "free": "32.6gb",
  167. "free_in_bytes": 35064553472,
  168. "available": "32.4gb",
  169. "available_in_bytes": 34802409472
  170. },
  171. "plugins": [
  172. {
  173. "name": "analysis-icu",
  174. "version": "{version}",
  175. "description": "The ICU Analysis plugin integrates Lucene ICU module into elasticsearch, adding ICU relates analysis components.",
  176. "classname": "org.elasticsearch.plugin.analysis.icu.AnalysisICUPlugin",
  177. "has_native_controller": false
  178. },
  179. {
  180. "name": "ingest-geoip",
  181. "version": "{version}",
  182. "description": "Ingest processor that uses looksup geo data based on ip adresses using the Maxmind geo database",
  183. "classname": "org.elasticsearch.ingest.geoip.IngestGeoIpPlugin",
  184. "has_native_controller": false
  185. },
  186. {
  187. "name": "ingest-user-agent",
  188. "version": "{version}",
  189. "description": "Ingest processor that extracts information from a user agent",
  190. "classname": "org.elasticsearch.ingest.useragent.IngestUserAgentPlugin",
  191. "has_native_controller": false
  192. }
  193. ],
  194. "network_types" : {
  195. "transport_types" : {
  196. "netty4" : 1
  197. },
  198. "http_types" : {
  199. "netty4" : 1
  200. }
  201. }
  202. }
  203. }
  204. --------------------------------------------------
  205. // TESTRESPONSE[s/"plugins": \[[^\]]*\]/"plugins": $body.$_path/]
  206. // TESTRESPONSE[s/: (\-)?[0-9]+/: $body.$_path/]
  207. // TESTRESPONSE[s/: "[^"]*"/: $body.$_path/]
  208. ////
  209. The TESTRESPONSE above replace all the fields values by the expected ones in the test,
  210. because we don't really care about the field values but we want to check the fields names.
  211. ////