node-cache-stats.asciidoc 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. [role="xpack"]
  2. [[searchable-snapshots-api-cache-stats]]
  3. === Cache stats API
  4. ++++
  5. <titleabbrev>Cache stats</titleabbrev>
  6. ++++
  7. .New API reference
  8. [sidebar]
  9. --
  10. For the most up-to-date API details, refer to {api-es}/group/endpoint-searchable_snapshots[Searchable snapshots APIs].
  11. --
  12. Retrieves statistics about the shared cache for <<partially-mounted,partially
  13. mounted indices>>.
  14. [[searchable-snapshots-api-cache-stats-request]]
  15. ==== {api-request-title}
  16. `GET /_searchable_snapshots/cache/stats` +
  17. `GET /_searchable_snapshots/<node_id>/cache/stats`
  18. [[searchable-snapshots-api-cache-stats-prereqs]]
  19. ==== {api-prereq-title}
  20. If the {es} {security-features} are enabled, you must have the
  21. `manage` cluster privilege to use this API.
  22. For more information, see <<security-privileges>>.
  23. [[searchable-snapshots-api-cache-stats-path-params]]
  24. ==== {api-path-parms-title}
  25. `<node_id>`::
  26. (Optional, string) The names of particular nodes in the cluster to target.
  27. For example, `nodeId1,nodeId2`. For node selection options, see
  28. <<cluster-nodes>>.
  29. //[[searchable-snapshots-api-cache-stats-query-params]]
  30. //==== {api-query-parms-title}
  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. Gets the statistics about the shared cache for partially mounted indices from
  77. all data nodes:
  78. [source,console]
  79. --------------------------------------------------
  80. GET /_searchable_snapshots/cache/stats
  81. --------------------------------------------------
  82. // TEST[setup:node]
  83. The API returns the following response:
  84. [source,console-result]
  85. ----
  86. {
  87. "nodes" : {
  88. "eerrtBMtQEisohZzxBLUSw" : {
  89. "shared_cache" : {
  90. "reads" : 6051,
  91. "bytes_read_in_bytes" : 5448829,
  92. "writes" : 37,
  93. "bytes_written_in_bytes" : 1208320,
  94. "evictions" : 5,
  95. "num_regions" : 65536,
  96. "size_in_bytes" : 1099511627776,
  97. "region_size_in_bytes" : 16777216
  98. }
  99. }
  100. }
  101. }
  102. ----
  103. // TESTRESPONSE[s/"reads" : 6051/"reads" : 0/]
  104. // TESTRESPONSE[s/"bytes_read_in_bytes" : 5448829/"bytes_read_in_bytes" : 0/]
  105. // TESTRESPONSE[s/"writes" : 37/"writes" : 0/]
  106. // TESTRESPONSE[s/"bytes_written_in_bytes" : 1208320/"bytes_written_in_bytes" : 0/]
  107. // TESTRESPONSE[s/"evictions" : 5/"evictions" : 0/]
  108. // TESTRESPONSE[s/"num_regions" : 65536/"num_regions" : 0/]
  109. // TESTRESPONSE[s/"size_in_bytes" : 1099511627776/"size_in_bytes" : 0/]
  110. // TESTRESPONSE[s/"eerrtBMtQEisohZzxBLUSw"/\$node_name/]