public long loads() { return stats.loadCount(); }
/** * Gets the ratio of script compilation attempts that failed. */ public double getClassCacheLoadFailureRate() { // don't use classMap.stats().loadFailureRate() because the load mechanism always succeeds with a future // that will in turn contain the success or failure long totalLoadCount = classMap.stats().loadCount(); return (totalLoadCount == 0) ? 0.0 : (double) failedCompilationCount.longValue() / totalLoadCount; }
/** * Gets the total number of times the cache lookup method attempted to compile new scripts. */ public long getClassCacheLoadCount() { return classMap.stats().loadCount(); }
/** * Gets the total number of times the cache lookup method succeeded to compile a new script. */ public long getClassCacheLoadSuccessCount() { // don't use classMap.stats().loadSuccessCount() because the load mechanism always succeeds with a future // that will in turn contain the success or failure return classMap.stats().loadCount() - failedCompilationCount.longValue(); }
public void testEmpty() { CacheStats stats = new CacheStats(0, 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.loadFailureCount()); assertEquals(0.0, stats.loadFailureRate()); assertEquals(0, stats.loadCount()); assertEquals(0, stats.totalLoadTime()); assertEquals(0.0, stats.averageLoadPenalty()); assertEquals(0, stats.evictionCount()); }
public void testSingle() { CacheStats stats = new CacheStats(11, 13, 17, 19, 23, 27, 54); 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.loadFailureCount()); assertEquals(19.0/36, stats.loadFailureRate()); assertEquals(17 + 19, stats.loadCount()); assertEquals(23, stats.totalLoadTime()); assertEquals(23.0/(17 + 19), stats.averageLoadPenalty()); assertEquals(27, stats.evictionCount()); assertEquals(54, stats.evictionWeight()); }
public void testPlus() { CacheStats one = new CacheStats(11, 13, 15, 13, 11, 9, 18); CacheStats two = new CacheStats(53, 47, 41, 39, 37, 35, 70); 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.loadFailureCount()); assertEquals(52.0/108, sum.loadFailureRate()); assertEquals(56 + 52, sum.loadCount()); assertEquals(48, sum.totalLoadTime()); assertEquals(48.0/(56 + 52), sum.averageLoadPenalty()); assertEquals(44, sum.evictionCount()); assertEquals(88, sum.evictionWeight()); assertEquals(sum, one.plus(two)); } }
public void testMinus() { CacheStats one = new CacheStats(11, 13, 17, 19, 23, 27, 54); CacheStats two = new CacheStats(53, 47, 43, 41, 37, 31, 62); 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.loadFailureCount()); assertEquals(22.0/48, diff.loadFailureRate()); assertEquals(26 + 22, diff.loadCount()); assertEquals(14, diff.totalLoadTime()); assertEquals(14.0/(26 + 22), diff.averageLoadPenalty()); assertEquals(4, diff.evictionCount()); assertEquals(8, diff.evictionWeight()); assertEquals(new CacheStats(0, 0, 0, 0, 0, 0, 0), one.minus(two)); }
/** * Gets the total number of times the cache lookup method attempted to compile new scripts. */ public long getClassCacheLoadCount() { return classMap.stats().loadCount(); }
/** * Gets the total number of times the cache lookup method succeeded to compile a new script. */ public long getClassCacheLoadSuccessCount() { // don't use classMap.stats().loadSuccessCount() because the load mechanism always succeeds with a future // that will in turn contain the success or failure return classMap.stats().loadCount() - failedCompilationCount.longValue(); }
/** * Gets the ratio of script compilation attempts that failed. */ public double getClassCacheLoadFailureRate() { // don't use classMap.stats().loadFailureRate() because the load mechanism always succeeds with a future // that will in turn contain the success or failure long totalLoadCount = classMap.stats().loadCount(); return (totalLoadCount == 0) ? 0.0 : (double) failedCompilationCount.longValue() / totalLoadCount; }
@Override public void serialize(CacheStats value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeNumberField("requestCount", value.requestCount()); gen.writeNumberField("hitCount", value.hitCount()); gen.writeNumberField("hitRate", value.hitRate()); gen.writeNumberField("missCount", value.missCount()); gen.writeNumberField("missRate", value.missRate()); gen.writeNumberField("loadCount", value.loadCount()); gen.writeNumberField("loadSuccessCount", value.loadSuccessCount()); gen.writeNumberField("loadFailureCount", value.loadFailureCount()); gen.writeNumberField("loadFailureRate", value.loadFailureRate()); gen.writeNumberField("totalLoadTime", value.totalLoadTime()); gen.writeNumberField("averageLoadPenalty", value.averageLoadPenalty()); gen.writeNumberField("evictionCount", value.evictionCount()); gen.writeNumberField("evictionWeight", value.evictionWeight()); gen.writeEndObject(); } }
@Override public void serialize(CacheStats value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeNumberField("requestCount", value.requestCount()); gen.writeNumberField("hitCount", value.hitCount()); gen.writeNumberField("hitRate", value.hitRate()); gen.writeNumberField("missCount", value.missCount()); gen.writeNumberField("missRate", value.missRate()); gen.writeNumberField("loadCount", value.loadCount()); gen.writeNumberField("loadSuccessCount", value.loadSuccessCount()); gen.writeNumberField("loadFailureCount", value.loadFailureCount()); gen.writeNumberField("loadFailureRate", value.loadFailureRate()); gen.writeNumberField("totalLoadTime", value.totalLoadTime()); gen.writeNumberField("averageLoadPenalty", value.averageLoadPenalty()); gen.writeNumberField("evictionCount", value.evictionCount()); gen.writeNumberField("evictionWeight", value.evictionWeight()); gen.writeEndObject(); } }
@Override public void serialize(CacheStats value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeNumberField("requestCount", value.requestCount()); gen.writeNumberField("hitCount", value.hitCount()); gen.writeNumberField("hitRate", value.hitRate()); gen.writeNumberField("missCount", value.missCount()); gen.writeNumberField("missRate", value.missRate()); gen.writeNumberField("loadCount", value.loadCount()); gen.writeNumberField("loadSuccessCount", value.loadSuccessCount()); gen.writeNumberField("loadFailureCount", value.loadFailureCount()); gen.writeNumberField("loadFailureRate", value.loadFailureRate()); gen.writeNumberField("totalLoadTime", value.totalLoadTime()); gen.writeNumberField("averageLoadPenalty", value.averageLoadPenalty()); gen.writeNumberField("evictionCount", value.evictionCount()); gen.writeNumberField("evictionWeight", value.evictionWeight()); gen.writeEndObject(); } }
row.put(JMX_PN_VALUE, String.valueOf(cacheStats.loadCount())); tabularData.put(new CompositeDataSupport(cacheEntryType, row));
public void printCacheStat(String name, Cache<?,?> cache){ CacheStats s = cache.stats(); System.out.printf( "%35s: %6d (EV) %6d (HC) %5.1f (HR) %6d (LC) %6d (LFC) %5.1f (LFR) %6d (LSC) %6d (MC) %5.1f (MR) %6d (RC) %10.1f (ALP) \n", //"%35s: %12.0f (ALP) %f (HR) %d (RC)\n", name, s.evictionCount(), s.hitCount(), s.hitRate(), s.loadCount(), s.loadFailureCount(), s.loadFailureRate(), s.loadSuccessCount(), s.missCount(), s.missRate(), s.requestCount(), s.averageLoadPenalty()); }