Enum DisabledStatsCounter

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      INSTANCE  
    • Constructor Detail

      • DisabledStatsCounter

        private DisabledStatsCounter()
    • Method Detail

      • values

        public static DisabledStatsCounter[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (DisabledStatsCounter c : DisabledStatsCounter.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static DisabledStatsCounter valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • recordHits

        public void recordHits​(int count)
        Description copied from interface: StatsCounter
        Records cache hits. This should be called when a cache request returns a cached value.
        Specified by:
        recordHits in interface StatsCounter
        Parameters:
        count - the number of hits to record
      • recordMisses

        public void recordMisses​(int count)
        Description copied from interface: StatsCounter
        Records cache misses. This should be called when a cache request returns a value that was not found in the cache. This method should be called by the loading thread, as well as by threads blocking on the load. Multiple concurrent calls to Cache lookup methods with the same key on an absent value should result in a single call to either recordLoadSuccess or recordLoadFailure and multiple calls to this method, despite all being served by the results of a single load operation.
        Specified by:
        recordMisses in interface StatsCounter
        Parameters:
        count - the number of misses to record
      • recordEviction

        public void recordEviction()
        Description copied from interface: StatsCounter
        Records the eviction of an entry from the cache. This should only been called when an entry is evicted due to the cache's eviction strategy, and not as a result of manual invalidations.
        Specified by:
        recordEviction in interface StatsCounter
      • snapshot

        public CacheStats snapshot()
        Description copied from interface: StatsCounter
        Returns a snapshot of this counter's values. Note that this may be an inconsistent view, as it may be interleaved with update operations.

        Note: the values of the metrics are undefined in case of overflow (though it is guaranteed not to throw an exception). If you require specific handling, we recommend implementing your own stats collector.

        Specified by:
        snapshot in interface StatsCounter
        Returns:
        a snapshot of this counter's values
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Enum<DisabledStatsCounter>