/** * Returns a set of statistics about the cache contents and usage. * * @return a set of statistics about the cache contents and usage */ public CacheStats stats() { return cache.stats(); } }
/** * Returns a set of statistics about the cache contents and usage. * * @return a set of statistics about the cache contents and usage */ public CacheStats stats() { return cache.stats(); }
private void status() { int drainStatus; int pendingWrites; local.evictionLock.lock(); try { pendingWrites = local.writeBuffer().size(); drainStatus = local.drainStatus(); } finally { local.evictionLock.unlock(); } LocalTime elapsedTime = LocalTime.ofSecondOfDay(stopwatch.elapsed(TimeUnit.SECONDS)); System.out.printf("---------- %s ----------%n", elapsedTime); System.out.printf("Pending reads: %,d; writes: %,d%n", local.readBuffer.size(), pendingWrites); System.out.printf("Drain status = %s (%s)%n", STATUS[drainStatus], drainStatus); System.out.printf("Evictions = %,d%n", cache.stats().evictionCount()); System.out.printf("Size = %,d (max: %,d)%n", local.data.mappingCount(), operation.maxEntries); System.out.printf("Lock = [%s%n", StringUtils.substringAfter( local.evictionLock.toString(), "[")); System.out.printf("Pending tasks = %,d%n", ForkJoinPool.commonPool().getQueuedSubmissionCount()); long maxMemory = Runtime.getRuntime().maxMemory(); long freeMemory = Runtime.getRuntime().freeMemory(); long allocatedMemory = Runtime.getRuntime().totalMemory(); System.out.printf("Max Memory = %,d bytes%n", maxMemory); System.out.printf("Free Memory = %,d bytes%n", freeMemory); System.out.printf("Allocated Memory = %,d bytes%n", allocatedMemory); System.out.println(); }
/** * Gets the average time spent compiling new scripts. */ public double getClassCacheAverageLoadPenalty() { return classMap.stats().averageLoadPenalty(); }
/** * Gets the total number of times the cache lookup method returned a cached or uncached value. */ public long getClassCacheRequestCount() { return classMap.stats().missCount(); }
/** * Gets the number of times a script compiled to a class has been evicted from the cache. */ public long getClassCacheEvictionCount() { return classMap.stats().evictionCount(); }
/** * Gets the sum of the weights of evicted entries from the class cache. */ public long getClassCacheEvictionWeight() { return classMap.stats().evictionWeight(); }
/** * Gets the hit rate of the class cache. */ public double getClassCacheHitRate() { return classMap.stats().hitRate(); }
/** * Gets the total number of times the cache lookup method attempted to compile new scripts. */ public long getClassCacheLoadCount() { return classMap.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 returned a newly compiled script. */ public long getClassCacheMissCount() { return classMap.stats().missCount(); }
/** * Gets the number of times cache look up for a compiled script returned a cached value. */ public long getClassCacheHitCount() { return classMap.stats().hitCount(); }
/** * 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 were misses. */ public double getClassCacheMissRate() { return classMap.stats().missRate(); }
/** * Gets the total number of nanoseconds that the cache spent compiling scripts. */ public long getClassCacheTotalLoadTime() { return classMap.stats().totalLoadTime(); }
/** * 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 returned a newly compiled script. */ public long getClassCacheMissCount() { return classMap.stats().missCount(); }
/** * Gets the total number of nanoseconds that the cache spent compiling scripts. */ public long getClassCacheTotalLoadTime() { return classMap.stats().totalLoadTime(); }
/** * Gets the sum of the weights of evicted entries from the class cache. */ public long getClassCacheEvictionWeight() { return classMap.stats().evictionWeight(); }
/** * Gets the number of times a script compiled to a class has been evicted from the cache. */ public long getClassCacheEvictionCount() { return classMap.stats().evictionCount(); }