有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java能告诉我们Guava缓存是在禁用统计数据的情况下构建的吗?

recordStats
public CacheBuilder<K,V> recordStats()
Enable the accumulation of CacheStats during the operation of the cache. Without this Cache.stats() will return zero for all statistics. Note that recording stats requires bookkeeping to be performed with each operation, and thus imposes a performance penalty on cache operation.

从JavaDocs for[CacheBuilder.recordStats()][2]中,添加了强调

据我所知,无法区分从未调用过的缓存和未调用recordStats()以实现统计数据累积的缓存。{a1}接口本身似乎没有暴露任何迹象。我错了吗

如果没有记录这种方法或标志,为什么不记录?10次中有9次,应该很明显你的缓存实际上正在被调用,但我今天浪费了一个小时试图弄清楚为什么我的缓存没有记录统计数据


共 (0) 个答案