node-cache-stats.asciidoc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. [role="xpack"]
  2. [testenv="enterprise"]
  3. [[searchable-snapshots-api-cache-stats]]
  4. === Cache stats API
  5. ++++
  6. <titleabbrev>Cache stats</titleabbrev>
  7. ++++
  8. Provide statistics about the searchable snapshots <<shared-cache,shared cache>>.
  9. [[searchable-snapshots-api-cache-stats-request]]
  10. ==== {api-request-title}
  11. `GET /_searchable_snapshots/cache/stats` +
  12. `GET /_searchable_snapshots/<node_id>/cache/stats`
  13. [[searchable-snapshots-api-cache-stats-prereqs]]
  14. ==== {api-prereq-title}
  15. If the {es} {security-features} are enabled, you must have the
  16. `manage` cluster privilege to use this API.
  17. For more information, see <<security-privileges>>.
  18. [[searchable-snapshots-api-cache-stats-desc]]
  19. ==== {api-description-title}
  20. You can use the Cache Stats API to retrieve statistics about the
  21. usage of the <<shared-cache,shared cache>> on nodes in a cluster.
  22. [[searchable-snapshots-api-cache-stats-path-params]]
  23. ==== {api-path-parms-title}
  24. `<node_id>`::
  25. (Optional, string) The names of particular nodes in the cluster to target.
  26. For example, `nodeId1,nodeId2`. For node selection options, see
  27. <<cluster-nodes>>.
  28. [[searchable-snapshots-api-cache-stats-query-params]]
  29. ==== {api-query-parms-title}
  30. include::{es-repo-dir}/rest-api/common-parms.asciidoc[tag=master-timeout]
  31. [role="child_attributes"]
  32. [[searchable-snapshots-api-cache-stats-response-body]]
  33. ==== {api-response-body-title}
  34. `nodes`::
  35. (object)
  36. Contains statistics for the nodes selected by the request.
  37. +
  38. .Properties of `nodes`
  39. [%collapsible%open]
  40. ====
  41. `<node_id>`::
  42. (object)
  43. Contains statistics for the node with the given identifier.
  44. +
  45. .Properties of `<node_id>`
  46. [%collapsible%open]
  47. =====
  48. `shared_cache`::
  49. (object)
  50. Contains statistics about the shared cache file.
  51. +
  52. .Properties of `shared_cache`
  53. [%collapsible%open]
  54. ======
  55. `reads`::
  56. (long) Number of times the shared cache is used to read data from.
  57. `bytes_read_in_bytes`::
  58. (long) The total of bytes read from the shared cache.
  59. `writes`::
  60. (long) Number of times data from the blob store repository is written in the shared cache.
  61. `bytes_written_in_bytes`::
  62. (long) The total of bytes written in the shared cache.
  63. `evictions`::
  64. (long) Number of regions evicted from the shared cache file.
  65. `num_regions`::
  66. (integer) Number of regions in the shared cache file.
  67. `size_in_bytes`::
  68. (long) The total size in bytes of the shared cache file.
  69. `region_size_in_bytes`::
  70. (long) The size in bytes of a region in the shared cache file.
  71. ======
  72. =====
  73. ====
  74. [[searchable-snapshots-api-cache-stats-example]]
  75. ==== {api-examples-title}
  76. Retrieves the searchable snapshots shared cache file statistics for all data nodes:
  77. [source,console]
  78. --------------------------------------------------
  79. GET /_searchable_snapshots/cache/stats
  80. --------------------------------------------------
  81. // TEST[setup:node]
  82. The API returns the following response:
  83. [source,console-result]
  84. ----
  85. {
  86. "nodes" : {
  87. "eerrtBMtQEisohZzxBLUSw" : {
  88. "shared_cache" : {
  89. "reads" : 6051,
  90. "bytes_read_in_bytes" : 5448829,
  91. "writes" : 37,
  92. "bytes_written_in_bytes" : 1208320,
  93. "evictions" : 5,
  94. "num_regions" : 65536,
  95. "size_in_bytes" : 1099511627776,
  96. "region_size_in_bytes" : 16777216
  97. }
  98. }
  99. }
  100. }
  101. ----
  102. // TESTRESPONSE[s/"reads" : 6051/"reads" : 0/]
  103. // TESTRESPONSE[s/"bytes_read_in_bytes" : 5448829/"bytes_read_in_bytes" : 0/]
  104. // TESTRESPONSE[s/"writes" : 37/"writes" : 0/]
  105. // TESTRESPONSE[s/"bytes_written_in_bytes" : 1208320/"bytes_written_in_bytes" : 0/]
  106. // TESTRESPONSE[s/"evictions" : 5/"evictions" : 0/]
  107. // TESTRESPONSE[s/"num_regions" : 65536/"num_regions" : 0/]
  108. // TESTRESPONSE[s/"size_in_bytes" : 1099511627776/"size_in_bytes" : 0/]
  109. // TESTRESPONSE[s/"eerrtBMtQEisohZzxBLUSw"/\$node_name/]