Class CacheStatisticsUtils
- java.lang.Object
-
- com.atlassian.confluence.impl.vcache.metrics.CacheStatisticsUtils
-
public class CacheStatisticsUtils extends Object
Various utilities for Cache Statistics.- Since:
- 5.10
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Stream<CacheStatistics>
collectVCacheStats(com.atlassian.vcache.internal.RequestMetrics metrics)
Converts VCache metrics into a stream ofCacheStatistics
objects.static Stream<CacheStatistics>
convertVCacheMetrics(String cacheType, Map<String,Map<com.atlassian.vcache.internal.MetricLabel,? extends com.atlassian.vcache.internal.LongMetric>> cachesMetrics)
Converts VCaches statistics into stream ofCacheStatistics
.static CacheStatistics
fromVCacheStatistics(String name, String cacheType, Map<com.atlassian.vcache.internal.MetricLabel,com.atlassian.vcache.internal.LongMetric> metrics)
Converts VCache statistics intoCacheStatistics
object.static Map<String,Long>
remoteStats(com.atlassian.vcache.internal.RequestMetrics metrics)
-
-
-
Method Detail
-
collectVCacheStats
public static Stream<CacheStatistics> collectVCacheStats(com.atlassian.vcache.internal.RequestMetrics metrics)
Converts VCache metrics into a stream ofCacheStatistics
objects.- Parameters:
metrics
- metrics to convert- Returns:
- statistics for each cache
-
fromVCacheStatistics
public static CacheStatistics fromVCacheStatistics(String name, String cacheType, Map<com.atlassian.vcache.internal.MetricLabel,com.atlassian.vcache.internal.LongMetric> metrics)
Converts VCache statistics intoCacheStatistics
object.- Parameters:
name
- name of the cache.cacheType
- type of the cache (e.g. External, Request, JVM).metrics
- metrics gathered for the cache.
-
convertVCacheMetrics
public static Stream<CacheStatistics> convertVCacheMetrics(String cacheType, Map<String,Map<com.atlassian.vcache.internal.MetricLabel,? extends com.atlassian.vcache.internal.LongMetric>> cachesMetrics)
Converts VCaches statistics into stream ofCacheStatistics
.- Parameters:
cacheType
- type of the cache (e.g. External, Request, JVM).cachesMetrics
- map containg cache name as a key and metrics for that cache as a value.- Returns:
- stream of
CacheStatistics
-
-