Skip to content

Commit

Permalink
add info about chunks cache into health endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
kobayurii committed Dec 30, 2024
1 parent 5d5228f commit 1eb438e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions rpc-server/src/health.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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,
Expand Down

0 comments on commit 1eb438e

Please sign in to comment.