-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Statistics
Ben Manes edited this page Mar 23, 2015
·
8 revisions
Cache<Key, Graph> graphs = Caffeine.newBuilder()
.maximumSize(10_000)
.recordStats()
.build();
By using Caffeine.recordStats()
, you can turn on statistics collection. The Cache.stats()
method returns a CacheStats
which provides statistics such as
-
hitRate():
returns the ratio of hits to requests -
averageLoadPenalty():
the average time spent loading new values, in nanoseconds -
evictionCount():
the number of cache evictions
These statistics are critical in cache tuning and we advise keeping an eye on these statistics in performance-critical applications.