Exemplo n.º 1
0
 @Override
 public MonitorCollector<CacheMetrics> collect() {
   MonitorCollector<CacheMetrics> collector = new MonitorCollector<CacheMetrics>();
   Jedis resource = CacheManager.getConnectionPool().getResource();
   if (resource != null) {
     CacheMetrics cacheMetrics = prepareCacheMetric(resource.info());
     cacheMetrics.setPing(resource.ping());
     collector.addMetrics(cacheMetrics);
     CacheManager.getConnectionPool().returnResource(resource);
   }
   return collector;
 }