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 Details

    • collectVCacheStats

      public static Stream<CacheStatistics> collectVCacheStats(com.atlassian.vcache.internal.RequestMetrics metrics)
      Converts VCache metrics into a stream of CacheStatistics 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 into CacheStatistics 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 of CacheStatistics.
      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
    • remoteStats

      public static Map<String,Long> remoteStats(com.atlassian.vcache.internal.RequestMetrics metrics)