Examples of hitRate()


Examples of com.google.common.cache.CacheStats.hitRate()

    subtree.addInt("missCount", stats.missCount());
    subtree.addInt("requestCount", stats.requestCount());
    subtree.addInt("totalLoadTime", stats.totalLoadTime());

    subtree.addFloat("averageLoadPenalty", stats.averageLoadPenalty());
    subtree.addFloat("hitRate", stats.hitRate());
    subtree.addFloat("loadExceptionRate", stats.loadExceptionRate());
    subtree.addFloat("missRate", stats.missRate());
  }
}
View Full Code Here

Examples of com.google.common.cache.CacheStats.hitRate()

                if (evictions >= nextLogThreshold) {
                    Logger logger = Logger.getLogger(ConfigAdapterImpl.class);
                    CacheStats stats = cache.stats();
                    logger.info(String.format(
                        "Cache %s evicted %d entries for size pressure, hit rate=%.3f, evictions=%d, loads=%d %s",
                        name, evictions, stats.hitRate(), stats.evictionCount(),
                        stats.loadCount(), stats.toString()));
                    // We want to log every 10 until 100, every 100 until 1000, every 1000 thereafter
                    if (nextLogThreshold == 1) {
                        nextLogThreshold = 10;
                    } else if (nextLogThreshold < 100) {
View Full Code Here

Examples of com.google.common.cache.CacheStats.hitRate()

            }
            if (System.currentTimeMillis() >= lastFull + ONE_DAY) {
                Logger logger = Logger.getLogger(ConfigAdapterImpl.class);
                CacheStats stats = cache.stats();
                logger.info(String.format("Cache %s has hit rate=%.3f, stats %s\n",
                        name, stats.hitRate(), stats.toString()));
            }
        }
    };

  private com.google.common.cache.Cache<K, T> cache;
View Full Code Here

Examples of com.google.common.cache.CacheStats.hitRate()

      StringBuilder stringBuilder = new StringBuilder();
      CacheStats cacheStats = cacheResource.getCacheStats().minus(relativeCacheStats);

      stringBuilder.append(String.format("Total succesful loaded values: %d %n", cacheStats.loadSuccessCount()));
      stringBuilder.append(String.format("Total requests: %d %n", cacheStats.requestCount()));
      stringBuilder.append(String.format("Hits ratio: %d/%d - %.3f %n", cacheStats.hitCount(), cacheStats.missCount(), cacheStats.hitRate()));
      stringBuilder.append(String.format("Average time spent loading new values (nanoseconds): %.3f %n", cacheStats.averageLoadPenalty()));
      stringBuilder.append(String.format("Number of cache evictions: %d %n", cacheStats.evictionCount()));

      return stringBuilder.toString();
    }
View Full Code Here

Examples of com.google.common.cache.CacheStats.hitRate()

        @Override
        public void run() {
          CacheStats cacheStats = cacheResource.getCacheStats().minus(relativeCacheStats);

          String csvStats = String.format("%.3f, %.3f, %d %n", cacheStats.hitRate(), cacheStats.averageLoadPenalty(), cacheStats.evictionCount());
          try {
            com.google.common.io.Files.append(csvStats, cacheLog, Charset.defaultCharset());
          } catch (IOException e) {
          }
        }
View Full Code Here

Examples of com.google.common.cache.CacheStats.hitRate()

        }

        if (log.isDebugEnabled()) {
            log.debug("Cache statistics :");
            log.debug("\t\t- hits count : {}", cacheStats.hitCount());
            log.debug("\t\t- hits rate : {}", cacheStats.hitRate());
            log.debug("\t\t- miss count : {}", cacheStats.missCount());
            log.debug("\t\t- miss rate : {}", cacheStats.missRate());
            log.debug("\t\t- eviction count : {}", cacheStats.evictionCount());
            log.debug("\t\t- load count : {}", cacheStats.loadCount());
            log.debug("\t\t- load success count : {}", cacheStats.loadSuccessCount());
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.