Package org.apache.maven.impl.cache
Class CacheStatistics
java.lang.Object
org.apache.maven.impl.cache.CacheStatistics
Cache statistics that tracks detailed metrics
about cache performance and usage patterns.
This implementation integrates with the improved cache architecture and provides thread-safe statistics tracking with minimal performance overhead.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classStatistics for specific reference type combinations.static classDefault implementation of request type statistics.static classDefault implementation of retention statistics. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonglonglongdoubledoubleReturns the ratio of key evictions to total evictions.longReturns the total number of key evictions across all caches.Returns eviction statistics by retention policy.doublelongReturns the total number of evictions (keys + values).longdoubleReturns the ratio of value evictions to total evictions.longReturns the total number of value evictions across all caches.Returns value eviction statistics by retention policy.voidrecordCacheAccess(String keyRefType, String valueRefType, boolean hit) Records cache access for specific reference types.voidrecordCacheCreation(String keyRefType, String valueRefType, CacheRetention retention) Records cache creation with specific reference types.voidRecords a cached exception.voidrecordHit(String requestType, CacheRetention retention) Records a cache hit for the given request type and retention policy.voidrecordKeyEviction(CacheRetention retention) Records a key eviction for the specified retention policy.voidrecordMiss(String requestType, CacheRetention retention) Records a cache miss for the given request type and retention policy.voidrecordValueEviction(CacheRetention retention) Records a value eviction for the specified retention policy.voidregisterCacheSizeSupplier(CacheRetention retention, Supplier<Long> sizeSupplier) Registers a cache size supplier for the given retention policy.
-
Constructor Details
-
CacheStatistics
public CacheStatistics()
-
-
Method Details
-
getTotalRequests
public long getTotalRequests() -
getCacheHits
public long getCacheHits() -
getCacheMisses
public long getCacheMisses() -
getHitRatio
public double getHitRatio() -
getMissRatio
public double getMissRatio() -
getRequestTypeStatistics
-
getRetentionStatistics
-
getReferenceTypeStatistics
-
getCacheSizes
-
getCachedExceptions
public long getCachedExceptions() -
getKeyEvictions
public long getKeyEvictions()Returns the total number of key evictions across all caches. -
getValueEvictions
public long getValueEvictions()Returns the total number of value evictions across all caches. -
getTotalEvictions
public long getTotalEvictions()Returns the total number of evictions (keys + values). -
getKeyEvictionRatio
public double getKeyEvictionRatio()Returns the ratio of key evictions to total evictions. -
getValueEvictionRatio
public double getValueEvictionRatio()Returns the ratio of value evictions to total evictions. -
recordHit
Records a cache hit for the given request type and retention policy. -
recordMiss
Records a cache miss for the given request type and retention policy. -
recordCachedException
public void recordCachedException()Records a cached exception. -
recordKeyEviction
Records a key eviction for the specified retention policy. -
recordValueEviction
Records a value eviction for the specified retention policy. -
registerCacheSizeSupplier
Registers a cache size supplier for the given retention policy. -
getKeyEvictionsByRetention
Returns eviction statistics by retention policy. -
getValueEvictionsByRetention
Returns value eviction statistics by retention policy. -
recordCacheCreation
Records cache creation with specific reference types. -
recordCacheAccess
Records cache access for specific reference types.
-