Class CaffeineStatsCounter

  • All Implemented Interfaces:
    com.github.benmanes.caffeine.cache.stats.StatsCounter

    public class CaffeineStatsCounter
    extends java.lang.Object
    implements com.github.benmanes.caffeine.cache.stats.StatsCounter
    • Constructor Summary

      Constructors 
      Constructor Description
      CaffeineStatsCounter​(com.netflix.spectator.api.Registry registry, java.lang.String metricsPrefix)
      Constructs an instance for use by a single cache.
    • Constructor Detail

      • CaffeineStatsCounter

        public CaffeineStatsCounter​(com.netflix.spectator.api.Registry registry,
                                    java.lang.String metricsPrefix)
        Constructs an instance for use by a single cache.
        Parameters:
        registry - the registry of metric instances
        metricsPrefix - the prefix name for the metrics
    • Method Detail

      • recordHits

        public void recordHits​(int count)
        Specified by:
        recordHits in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • recordMisses

        public void recordMisses​(int count)
        Specified by:
        recordMisses in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • recordLoadSuccess

        public void recordLoadSuccess​(long loadTime)
        Specified by:
        recordLoadSuccess in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • recordLoadFailure

        public void recordLoadFailure​(long loadTime)
        Specified by:
        recordLoadFailure in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • recordEviction

        public void recordEviction()
        Specified by:
        recordEviction in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • recordEviction

        public void recordEviction​(int weight)
        Specified by:
        recordEviction in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • snapshot

        public com.github.benmanes.caffeine.cache.stats.CacheStats snapshot()
        Specified by:
        snapshot in interface com.github.benmanes.caffeine.cache.stats.StatsCounter
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object