java.lang.Object
org.miaixz.bus.cache.support.metrics.MemoryMetrics
- All Implemented Interfaces:
Metrics
内存缓存命中率统计实现
基于内存的缓存命中率统计实现,使用ConcurrentHashMap存储命中次数和请求次数, 支持并发更新,适用于单机环境或测试环境。
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.miaixz.bus.cache.Metrics
Metrics.Snapshot -
Constructor Summary
Constructors -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.cache.Metrics
summaryName
-
Constructor Details
-
MemoryMetrics
public MemoryMetrics()
-
-
Method Details
-
hitIncr
增加命中次数 -
reqIncr
增加请求次数 -
getHitting
获取缓存命中率统计信息- Specified by:
getHittingin interfaceMetrics- Returns:
- 缓存命中率统计映射,键为缓存模式/分组名称,值为HittingDO对象
-
reset
重置指定缓存模式的命中率统计 -
resetAll
public void resetAll()重置所有缓存模式的命中率统计
-