From 1eb438e9fb3f1fda10658d9a2364b1386edebf53 Mon Sep 17 00:00:00 2001 From: Yurii Koba Date: Mon, 30 Dec 2024 11:06:37 +0200 Subject: [PATCH] add info about chunks cache into health endpoint --- rpc-server/src/health.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/rpc-server/src/health.rs b/rpc-server/src/health.rs index 4b943852..98a5aac4 100644 --- a/rpc-server/src/health.rs +++ b/rpc-server/src/health.rs @@ -8,6 +8,10 @@ pub struct RPCHealthStatusResponse { max_blocks_cache_size: String, current_blocks_cache_size: String, + chunks_in_cache: usize, + max_chunks_cache_size: String, + current_chunks_cache_size: String, + contracts_codes_in_cache: usize, max_contracts_codes_cache_size: String, current_contracts_codes_cache_size: String, @@ -30,6 +34,14 @@ impl RPCHealthStatusResponse { server_context.blocks_cache.current_size().await, ), + chunks_in_cache: server_context.chunks_cache.len().await, + max_chunks_cache_size: friendly_memory_size_format( + server_context.chunks_cache.max_size().await, + ), + current_chunks_cache_size: friendly_memory_size_format( + server_context.chunks_cache.current_size().await, + ), + contracts_codes_in_cache: server_context.contract_code_cache.len().await, max_contracts_codes_cache_size: friendly_memory_size_format( server_context.contract_code_cache.max_size().await,