From 78bb2ef25a27d41d38468fc196081651f77a5b1f Mon Sep 17 00:00:00 2001 From: Amnon Heiman Date: Tue, 17 May 2016 11:36:38 +0300 Subject: [PATCH] CacheService: Do not get non existing caches metrics With the change in the meter implementation, retrieving a non existing metrics would take time. For this, the CacheService would mark caches that are not supported with null url, so the metrics will be register but will return 0 for all request (instead of going to the API that will return 0). Signed-off-by: Amnon Heiman --- src/main/java/org/apache/cassandra/service/CacheService.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/apache/cassandra/service/CacheService.java b/src/main/java/org/apache/cassandra/service/CacheService.java index fc56ad0..6655e1e 100644 --- a/src/main/java/org/apache/cassandra/service/CacheService.java +++ b/src/main/java/org/apache/cassandra/service/CacheService.java @@ -65,9 +65,9 @@ public class CacheService implements CacheServiceMBean { throw new RuntimeException(e); } - keyCache = new CacheMetrics("KeyCache", "key"); + keyCache = new CacheMetrics("KeyCache", null); rowCache = new CacheMetrics("RowCache", "row"); - counterCache = new CacheMetrics("CounterCache", "counter"); + counterCache = new CacheMetrics("CounterCache", null); } public int getRowCacheSavePeriodInSeconds() {