From a27a2d783538fdab7d708203d6d7a3bb441e15db Mon Sep 17 00:00:00 2001 From: Boubaker Khanfir Date: Tue, 26 Aug 2025 10:29:12 +0100 Subject: [PATCH] fix: Improve Cache Miss Count Warning Relevancy - MEED-9615 - Meeds-io/meeds#3598 Prior to this change, the Cache warning about miss count wasn't considering the ratio between hit and miss counts. This change ensures to not warn about miss count only when it's greater than twice. --- .../org/exoplatform/services/cache/concurrent/CacheState.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/CacheState.java b/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/CacheState.java index 1bd9429d7..039de2e58 100644 --- a/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/CacheState.java +++ b/exo.kernel.component.cache/src/main/java/org/exoplatform/services/cache/concurrent/CacheState.java @@ -164,9 +164,10 @@ public V remove(Serializable name) { private void traceExcessiveMissCountRatio() { int missCount = config.misses.get(); - int maxSize = config.getMaxSize(); int hitCount = config.hits.get(); + int maxSize = config.getMaxSize(); if (missCount > MIN_MISS_COUNT + && missCount > (hitCount * 2) && missCount % Math.max(MIN_MISS_COUNT, Math.min(maxSize, hitCount)) == 0) { // NOSONAR log.warn("Cache '{}' seems to have an excessive miss count '{}' (hits count: '{}'), please consider reviewing Max Size '{}' and TTL '{}s' configurations.", config.getName(),