Tabnine Logo
CacheStats.evictionCount
Code IndexAdd Tabnine to your IDE (free)

How to use
evictionCount
method
in
com.google.common.cache.CacheStats

Best Java code snippets using com.google.common.cache.CacheStats.evictionCount (Showing top 20 results out of 558)

origin: Netflix/EVCache

@Override
public Number getValue() {
  if (getCache() == null) return Long.valueOf(0);
  return Double.valueOf(getStats().evictionCount());
}
origin: Netflix/servo

@com.netflix.servo.annotations.Monitor(name = "evictionCount", type = COUNTER)
long evictionCount() {
 return memoStats.get().evictionCount();
}
origin: apache/incubator-druid

@Override
public LookupCacheStats getStats()
{
 return new LookupCacheStats(
   cache.stats().hitCount(),
   cache.stats().missCount(),
   cache.stats().evictionCount()
 );
}
origin: google/guava

assertEquals(removalListener.size(), stats.evictionCount());
assertEquals(computeCount.get(), stats.loadSuccessCount());
assertEquals(exceptionCount.get() + computeNullCount.get(), stats.loadExceptionCount());
origin: google/guava

 /** Increments all counters by the values in {@code other}. */
 public void incrementBy(StatsCounter other) {
  CacheStats otherStats = other.snapshot();
  hitCount.add(otherStats.hitCount());
  missCount.add(otherStats.missCount());
  loadSuccessCount.add(otherStats.loadSuccessCount());
  loadExceptionCount.add(otherStats.loadExceptionCount());
  totalLoadTime.add(otherStats.totalLoadTime());
  evictionCount.add(otherStats.evictionCount());
 }
}
origin: google/j2objc

 /** Increments all counters by the values in {@code other}. */
 public void incrementBy(StatsCounter other) {
  CacheStats otherStats = other.snapshot();
  hitCount.add(otherStats.hitCount());
  missCount.add(otherStats.missCount());
  loadSuccessCount.add(otherStats.loadSuccessCount());
  loadExceptionCount.add(otherStats.loadExceptionCount());
  totalLoadTime.add(otherStats.totalLoadTime());
  evictionCount.add(otherStats.evictionCount());
 }
}
origin: wildfly/wildfly

 /** Increments all counters by the values in {@code other}. */
 public void incrementBy(StatsCounter other) {
  CacheStats otherStats = other.snapshot();
  hitCount.add(otherStats.hitCount());
  missCount.add(otherStats.missCount());
  loadSuccessCount.add(otherStats.loadSuccessCount());
  loadExceptionCount.add(otherStats.loadExceptionCount());
  totalLoadTime.add(otherStats.totalLoadTime());
  evictionCount.add(otherStats.evictionCount());
 }
}
origin: ben-manes/caffeine

assertEquals(removalListener.size(), stats.evictionCount());
assertEquals(computeCount.get(), stats.loadSuccessCount());
assertEquals(exceptionCount.get() + computeNullCount.get(), stats.loadExceptionCount());
origin: ben-manes/caffeine

@Override
public CacheStats stats() {
 com.google.common.cache.CacheStats stats = statsCounter.snapshot().plus(cache.stats());
 return new CacheStats(stats.hitCount(), stats.missCount(), stats.loadSuccessCount(),
   stats.loadExceptionCount(), stats.totalLoadTime(), stats.evictionCount(), 0L);
}
origin: google/guava

assertTrue(totalLoadTime >= 0);
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(0, stats.evictionCount());
assertEquals(1.0 / 2, stats.missRate());
assertEquals(1, stats.loadCount());
assertEquals(0, stats.evictionCount());
totalLoadTime = stats.totalLoadTime();
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(0, stats.evictionCount());
totalLoadTime = stats.totalLoadTime();
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(1, stats.evictionCount());
origin: google/guava

public void testEmptySimpleStats() {
 StatsCounter counter = new SimpleStatsCounter();
 CacheStats stats = counter.snapshot();
 assertEquals(0, stats.requestCount());
 assertEquals(0, stats.hitCount());
 assertEquals(1.0, stats.hitRate());
 assertEquals(0, stats.missCount());
 assertEquals(0.0, stats.missRate());
 assertEquals(0, stats.loadSuccessCount());
 assertEquals(0, stats.loadExceptionCount());
 assertEquals(0, stats.loadCount());
 assertEquals(0, stats.totalLoadTime());
 assertEquals(0.0, stats.averageLoadPenalty());
 assertEquals(0, stats.evictionCount());
}
origin: google/guava

public void testEmpty() {
 CacheStats stats = new CacheStats(0, 0, 0, 0, 0, 0);
 assertEquals(0, stats.requestCount());
 assertEquals(0, stats.hitCount());
 assertEquals(1.0, stats.hitRate());
 assertEquals(0, stats.missCount());
 assertEquals(0.0, stats.missRate());
 assertEquals(0, stats.loadSuccessCount());
 assertEquals(0, stats.loadExceptionCount());
 assertEquals(0.0, stats.loadExceptionRate());
 assertEquals(0, stats.loadCount());
 assertEquals(0, stats.totalLoadTime());
 assertEquals(0.0, stats.averageLoadPenalty());
 assertEquals(0, stats.evictionCount());
}
origin: google/guava

public void testSingle() {
 CacheStats stats = new CacheStats(11, 13, 17, 19, 23, 27);
 assertEquals(24, stats.requestCount());
 assertEquals(11, stats.hitCount());
 assertEquals(11.0 / 24, stats.hitRate());
 assertEquals(13, stats.missCount());
 assertEquals(13.0 / 24, stats.missRate());
 assertEquals(17, stats.loadSuccessCount());
 assertEquals(19, stats.loadExceptionCount());
 assertEquals(19.0 / 36, stats.loadExceptionRate());
 assertEquals(17 + 19, stats.loadCount());
 assertEquals(23, stats.totalLoadTime());
 assertEquals(23.0 / (17 + 19), stats.averageLoadPenalty());
 assertEquals(27, stats.evictionCount());
}
origin: ben-manes/caffeine

assertTrue(totalLoadTime >= 0);
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(0, stats.evictionCount());
assertEquals(1.0/2, stats.missRate());
assertEquals(1, stats.loadCount());
assertEquals(0, stats.evictionCount());
totalLoadTime = stats.totalLoadTime();
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(0, stats.evictionCount());
totalLoadTime = stats.totalLoadTime();
assertTrue(stats.averageLoadPenalty() >= 0.0);
assertEquals(1, stats.evictionCount());
origin: google/guava

 public void testPlus() {
  CacheStats one = new CacheStats(11, 13, 15, 13, 11, 9);
  CacheStats two = new CacheStats(53, 47, 41, 39, 37, 35);

  CacheStats sum = two.plus(one);
  assertEquals(124, sum.requestCount());
  assertEquals(64, sum.hitCount());
  assertEquals(64.0 / 124, sum.hitRate());
  assertEquals(60, sum.missCount());
  assertEquals(60.0 / 124, sum.missRate());
  assertEquals(56, sum.loadSuccessCount());
  assertEquals(52, sum.loadExceptionCount());
  assertEquals(52.0 / 108, sum.loadExceptionRate());
  assertEquals(56 + 52, sum.loadCount());
  assertEquals(48, sum.totalLoadTime());
  assertEquals(48.0 / (56 + 52), sum.averageLoadPenalty());
  assertEquals(44, sum.evictionCount());

  assertEquals(sum, one.plus(two));
 }
}
origin: google/guava

public void testMinus() {
 CacheStats one = new CacheStats(11, 13, 17, 19, 23, 27);
 CacheStats two = new CacheStats(53, 47, 43, 41, 37, 31);
 CacheStats diff = two.minus(one);
 assertEquals(76, diff.requestCount());
 assertEquals(42, diff.hitCount());
 assertEquals(42.0 / 76, diff.hitRate());
 assertEquals(34, diff.missCount());
 assertEquals(34.0 / 76, diff.missRate());
 assertEquals(26, diff.loadSuccessCount());
 assertEquals(22, diff.loadExceptionCount());
 assertEquals(22.0 / 48, diff.loadExceptionRate());
 assertEquals(26 + 22, diff.loadCount());
 assertEquals(14, diff.totalLoadTime());
 assertEquals(14.0 / (26 + 22), diff.averageLoadPenalty());
 assertEquals(4, diff.evictionCount());
 assertEquals(new CacheStats(0, 0, 0, 0, 0, 0), one.minus(two));
}
origin: google/guava

assertEquals(214, stats.totalLoadTime());
assertEquals(214.0 / (13 + 17), stats.averageLoadPenalty());
assertEquals(27, stats.evictionCount());
origin: spring-projects/spring-integration

final Map<String, Object> cacheStatistics = new HashMap<String, Object>(11);
cacheStatistics.put("averageLoadPenalty", cacheStats.averageLoadPenalty());
cacheStatistics.put("evictionCount", cacheStats.evictionCount());
cacheStatistics.put("hitCount", cacheStats.hitCount());
cacheStatistics.put("hitRate", cacheStats.hitRate());
origin: prometheus/client_java

cacheMissTotal.addMetric(cacheName, stats.missCount());
cacheRequestsTotal.addMetric(cacheName, stats.requestCount());
cacheEvictionTotal.addMetric(cacheName, stats.evictionCount());
cacheSize.addMetric(cacheName, c.getValue().size());
origin: apache/samza

@Override
public void init(Context context) {
 super.init(context);
 TableMetricsUtil tableMetricsUtil = new TableMetricsUtil(context, this, tableId);
 // hit- and miss-rate are provided by CachingTable.
 tableMetricsUtil.newGauge("evict-count", () -> cache.stats().evictionCount());
}
com.google.common.cacheCacheStatsevictionCount

Javadoc

Returns the number of times an entry has been evicted. This count does not include manual Cache#invalidate.

Popular methods of CacheStats

  • hitCount
    Returns the number of times Cache lookup methods have returned a cached value.
  • missCount
    Returns the number of times Cache lookup methods have returned an uncached (newly loaded) value, or
  • loadExceptionCount
    Returns the number of times Cache lookup methods threw an exception while loading a new value. This
  • totalLoadTime
    Returns the total number of nanoseconds the cache has spent loading new values. This can be used to
  • loadSuccessCount
    Returns the number of times Cache lookup methods have successfully loaded a new value. This is alway
  • requestCount
    Returns the number of times Cache lookup methods have returned either a cached or uncached value. Th
  • hitRate
    Returns the ratio of cache requests which were hits. This is defined as hitCount / requestCount, or
  • loadCount
    Returns the total number of times that Cache lookup methods attempted to load new values. This inclu
  • <init>
    Constructs a new CacheStats instance.Five parameters of the same type in a row is a bad thing, but t
  • missRate
    Returns the ratio of cache requests which were misses. This is defined as missCount / requestCount,
  • averageLoadPenalty
    Returns the average time spent loading new values. This is defined as totalLoadTime / (loadSuccessCo
  • loadExceptionRate
    Returns the ratio of cache loading attempts which threw exceptions. This is defined as loadException
  • averageLoadPenalty,
  • loadExceptionRate,
  • toString,
  • minus,
  • plus

Popular in Java

  • Reactive rest calls using spring rest template
  • scheduleAtFixedRate (Timer)
  • onRequestPermissionsResult (Fragment)
  • notifyDataSetChanged (ArrayAdapter)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Notification (javax.management)
  • Base64 (org.apache.commons.codec.binary)
    Provides Base64 encoding and decoding as defined by RFC 2045.This class implements section 6.8. Base
  • Scheduler (org.quartz)
    This is the main interface of a Quartz Scheduler. A Scheduler maintains a registry of org.quartz.Job
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now