nodes-stats.asciidoc 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. [[cluster-nodes-stats]]
  2. == Nodes Stats
  3. [float]
  4. === Nodes statistics
  5. The cluster nodes stats API allows to retrieve one or more (or all) of
  6. the cluster nodes statistics.
  7. [source,js]
  8. --------------------------------------------------
  9. curl -XGET 'http://localhost:9200/_nodes/stats'
  10. curl -XGET 'http://localhost:9200/_nodes/nodeId1,nodeId2/stats'
  11. --------------------------------------------------
  12. The first command retrieves stats of all the nodes in the cluster. The
  13. second command selectively retrieves nodes stats of only `nodeId1` and
  14. `nodeId2`. All the nodes selective options are explained
  15. <<cluster-nodes,here>>.
  16. By default, all stats are returned. You can limit this by combining any
  17. of `indices`, `os`, `process`, `jvm`, `transport`, `http`,
  18. `fs`, `breaker` and `thread_pool`. For example:
  19. [horizontal]
  20. `indices`::
  21. Indices stats about size, document count, indexing and
  22. deletion times, search times, field cache size, merges and flushes
  23. `fs`::
  24. File system information, data path, free disk space, read/write
  25. stats (see <<fs-info,FS information>>)
  26. `http`::
  27. HTTP connection information
  28. `jvm`::
  29. JVM stats, memory pool information, garbage collection, buffer
  30. pools, number of loaded/unloaded classes
  31. `os`::
  32. Operating system stats, load average, cpu, mem, swap
  33. (see <<os-stats,OS statistics>>)
  34. `process`::
  35. Process statistics, memory consumption, cpu usage, open
  36. file descriptors (see <<process-stats,Process statistics>>)
  37. `thread_pool`::
  38. Statistics about each thread pool, including current
  39. size, queue and rejected tasks
  40. `transport`::
  41. Transport statistics about sent and received bytes in
  42. cluster communication
  43. `breaker`::
  44. Statistics about the field data circuit breaker
  45. [source,js]
  46. --------------------------------------------------
  47. # return indices and os
  48. curl -XGET 'http://localhost:9200/_nodes/stats/os'
  49. # return just os and process
  50. curl -XGET 'http://localhost:9200/_nodes/stats/os,process'
  51. # specific type endpoint
  52. curl -XGET 'http://localhost:9200/_nodes/stats/process'
  53. curl -XGET 'http://localhost:9200/_nodes/10.0.0.1/stats/process'
  54. --------------------------------------------------
  55. The `all` flag can be set to return all the stats.
  56. [float]
  57. [[fs-info]]
  58. ==== FS information
  59. The `fs` flag can be set to retrieve
  60. information that concern the file system:
  61. `fs.timestamp`::
  62. Last time the file stores statistics have been refreshed
  63. `fs.total.total_in_bytes`::
  64. Total size (in bytes) of all file stores
  65. `fs.total.free_in_bytes`::
  66. Total number of unallocated bytes in all file stores
  67. `fs.total.available_in_bytes`::
  68. Total number of bytes available to this Java virtual machine on all file stores
  69. `fs.data`::
  70. List of all file stores
  71. `fs.data.path`::
  72. Path to the file store
  73. `fs.data.mount`::
  74. Mount point of the file store (ex: /dev/sda2)
  75. `fs.data.type`::
  76. Type of the file store (ex: ext4)
  77. `fs.data.total_in_bytes`::
  78. Total size (in bytes) of the file store
  79. `fs.data.free_in_bytes`::
  80. Total number of unallocated bytes in the file store
  81. `fs.data.available_in_bytes`::
  82. Total number of bytes available to this Java virtual machine on this file store
  83. `fs.data.spins` (Linux only)::
  84. Indicates if the file store is backed by spinning storage.
  85. `null` means we could not determine it, `true` means the device possibly spins
  86. and `false` means it does not (ex: solid-state disks).
  87. [float]
  88. [[os-stats]]
  89. ==== Operating System statistics
  90. The `os` flag can be set to retrieve statistics that concern
  91. the operating system:
  92. `os.timestamp`::
  93. Last time the operating system statistics have been refreshed
  94. `os.load_average`::
  95. System load average for the last minute
  96. `os.mem.total_in_bytes`::
  97. Total amount of physical memory in bytes
  98. `os.mem.free_in_bytes`::
  99. Amount of free physical memory in bytes
  100. `os.mem.free_percent`::
  101. Percentage of free memory
  102. `os.mem.used_in_bytes`::
  103. Amount of used physical memory in bytes
  104. `os.mem.used_percent`::
  105. Percentage of used memory
  106. `os.swap.total_in_bytes`::
  107. Total amount of swap space in bytes
  108. `os.swap.free_in_bytes`::
  109. Amount of free swap space in bytes
  110. `os.swap.used_in_bytes`::
  111. Amount of used swap space in bytes
  112. [float]
  113. [[process-stats]]
  114. ==== Process statistics
  115. The `process` flag can be set to retrieve statistics that concern
  116. the current running process:
  117. `process.timestamp`::
  118. Last time the process statistics have been refreshed
  119. `process.open_file_descriptors`::
  120. Number of opened file descriptors associated with the current process, or -1 if not supported
  121. `process.max_file_descriptors`::
  122. Maximum number of file descriptors allowed on the system, or -1 if not supported
  123. `process.cpu.percent`::
  124. CPU usage in percent
  125. `process.cpu.total_in_millis`::
  126. CPU time (in milliseconds) used by the process on which the Java virtual machine is running, or -1 if not supported
  127. `process.mem.total_virtual_in_bytes`::
  128. Size in bytes of virtual memory that is guaranteed to be available to the running process
  129. [float]
  130. [[field-data]]
  131. === Field data statistics
  132. You can get information about field data memory usage on node
  133. level or on index level.
  134. [source,js]
  135. --------------------------------------------------
  136. # Node Stats
  137. curl -XGET 'http://localhost:9200/_nodes/stats/indices/?fields=field1,field2&pretty'
  138. # Indices Stat
  139. curl -XGET 'http://localhost:9200/_stats/fielddata/?fields=field1,field2&pretty'
  140. # You can use wildcards for field names
  141. curl -XGET 'http://localhost:9200/_stats/fielddata/?fields=field*&pretty'
  142. curl -XGET 'http://localhost:9200/_nodes/stats/indices/?fields=field*&pretty'
  143. --------------------------------------------------
  144. [float]
  145. [[search-groups]]
  146. === Search groups
  147. You can get statistics about search groups for searches executed
  148. on this node.
  149. [source,js]
  150. --------------------------------------------------
  151. # All groups with all stats
  152. curl -XGET 'http://localhost:9200/_nodes/stats?pretty&groups=_all'
  153. # Some groups from just the indices stats
  154. curl -XGET 'http://localhost:9200/_nodes/stats/indices?pretty&groups=foo,bar'
  155. --------------------------------------------------