Instantiate the CacheMetrics

CacheService holds an instance of cache metrics per: key, row and counter.

This instantiate the different metrics. After this petch it will be
possible to connect with jsconsole and see those metrics

Signed-off-by: Amnon Heiman <amnon@cloudius-systems.com>
This commit is contained in:
Amnon Heiman 2015-07-01 10:11:21 +03:00
parent 19a7daf368
commit 366b744d7b

View File

@ -26,10 +26,13 @@ package org.apache.cassandra.service;
import java.lang.management.ManagementFactory;
import java.util.concurrent.ExecutionException;
import javax.management.MBeanServer;
import javax.management.ObjectName;
import javax.ws.rs.core.MultivaluedMap;
import org.apache.cassandra.metrics.CacheMetrics;
import com.cloudius.urchin.api.APIClient;
import com.sun.jersey.core.util.MultivaluedMapImpl;
@ -44,6 +47,9 @@ public class CacheService implements CacheServiceMBean {
public static final String MBEAN_NAME = "org.apache.cassandra.db:type=Caches";
public final CacheMetrics keyCache;
public final CacheMetrics rowCache;
public final CacheMetrics counterCache;
public final static CacheService instance = new CacheService();
public static CacheService getInstance() {
@ -59,6 +65,9 @@ public class CacheService implements CacheServiceMBean {
throw new RuntimeException(e);
}
keyCache = new CacheMetrics("KeyCache", "key");
rowCache = new CacheMetrics("RowCache", "row");
counterCache = new CacheMetrics("CounterCache", "counter");
}
public int getRowCacheSavePeriodInSeconds() {