Java Code Examples for com.google.common.cache.CacheStats#hitCount()

The following examples show how to use com.google.common.cache.CacheStats#hitCount() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GlobalCache.java    From meghanada-server with GNU General Public License v3.0 5 votes vote down vote up
public long[] getMemberDescriptorsCountStats() throws ExecutionException {
  CacheStats cacheStats = this.memberCache.stats();
  return new long[] {
    cacheStats.hitCount(),
    cacheStats.loadCount(),
    cacheStats.loadExceptionCount(),
    cacheStats.loadSuccessCount(),
    cacheStats.missCount(),
    cacheStats.requestCount(),
  };
}
 
Example 2
Source File: MapCache.java    From dsl-devkit with Eclipse Public License 1.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override
public CacheStatistics getStatistics() {
  CacheStats stats = backend.stats();
  return new CacheStatistics(backend.size(), stats.hitCount(), stats.missCount());
}
 
Example 3
Source File: GuavaCacheImpl.java    From RxCache with Apache License 2.0 3 votes vote down vote up
public CacheStatistics getCacheStatistics() {

        CacheStats cacheStats = cache.stats();

        long evictionCount = cacheStats.evictionCount();
        long hitCount = cacheStats.hitCount();
        long missCount = cacheStats.missCount();

        return new CacheStatistics((int)maxSize,putCount.get(),(int)evictionCount,(int)hitCount,(int)missCount);
    }