Enum Class CacheStatisticsKey

java.lang.Object
java.lang.Enum<CacheStatisticsKey>
com.atlassian.cache.CacheStatisticsKey
All Implemented Interfaces:
Serializable, Comparable<CacheStatisticsKey>, Constable

public enum CacheStatisticsKey extends Enum<CacheStatisticsKey>
An immutable representation of a statistics key for a Cache. This class is used by ManagedCache.getStatistics() to dynamically distinguish different cache statistics available for a Cache.
Since:
v2.4.0
  • Enum Constant Details

    • SIZE

      public static final CacheStatisticsKey SIZE
      Returns the number of cached objects kept referenced by the Cache (depends on the cache implementation)
    • HEAP_SIZE

      public static final CacheStatisticsKey HEAP_SIZE
      Returns the number of bytes used by the Cache.

      Note: This is likely to be a very expensive statistic in some implementations, so consumers may want to discard it when it hasn't been explicitly requested. Even where available, the reported heap size is almost certain to be only an approximation of the cache's total memory use.

    • HIT_COUNT

      public static final CacheStatisticsKey HIT_COUNT
      Returns the number of times Cache lookup methods have returned a cached value.
    • PUT_COUNT

      public static final CacheStatisticsKey PUT_COUNT
      Returns the number of times Cache put methods have added a cached value.
    • REMOVE_COUNT

      public static final CacheStatisticsKey REMOVE_COUNT
      Returns the number of times Cache remove methods have removed a cached value.
    • MISS_COUNT

      public static final CacheStatisticsKey MISS_COUNT
      Returns the number of times Cache lookup methods have returned an uncached (newly loaded) value, or null. Multiple concurrent calls to Cache lookup methods on an absent value can result in multiple misses, all returning the results of a single cache load operation.
    • LOAD_COUNT

      public static final CacheStatisticsKey LOAD_COUNT
      Returns the total number of times that Cache lookup methods attempted to load new values.
    • LOAD_SUCCESS_COUNT

      public static final CacheStatisticsKey LOAD_SUCCESS_COUNT
      Returns the number of times Cache lookup methods have successfully loaded a new value.
    • LOAD_EXCEPTION_COUNT

      public static final CacheStatisticsKey LOAD_EXCEPTION_COUNT
      Returns the number of times Cache lookup methods threw an exception while loading a new value.
    • TOTAL_MISS_TIME

      public static final CacheStatisticsKey TOTAL_MISS_TIME
      Returns the number of nanoseconds spent computing values for cache misses. This is only relevant for caches using a CacheLoader.
    • TOTAL_LOAD_TIME

      public static final CacheStatisticsKey TOTAL_LOAD_TIME
      Returns the total number of nanoseconds the cache has spent loading new values.
    • EVICTION_COUNT

      public static final CacheStatisticsKey EVICTION_COUNT
      Returns the number of times an entry has been evicted.
    • REQUEST_COUNT

      public static final CacheStatisticsKey REQUEST_COUNT
      Returns the number of times Cache lookup methods have returned either a cached or uncached value.
  • Field Details

  • Method Details

    • values

      public static CacheStatisticsKey[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CacheStatisticsKey valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • getLabel

      @Nonnull public String getLabel()
      Returns the label for this cache statistics key. This is intended to be the same as the Enum.name(), except written in camelCase.
      Returns:
      the label for this cache statistics key.
    • getType

      @Nonnull public StatisticsType getType()
      Returns the type of statistic that this is. Different types of statistics might render differently in a user interface.
      Returns:
      the type of statistic that this is.