Interface WindowCache.StatsRecorder

    • Method Detail

      • recordHits

        void recordHits​(int count)
        Record cache hits. Called when cache returns a cached entry.
        Parameters:
        count - number of cache hits to record
      • recordMisses

        void recordMisses​(int count)
        Record cache misses. Called when the cache returns an entry which had to be loaded.
        Parameters:
        count - number of cache misses to record
      • recordLoadSuccess

        void recordLoadSuccess​(long loadTimeNanos)
        Record a successful load of a cache entry
        Parameters:
        loadTimeNanos - time to load a cache entry
      • recordLoadFailure

        void recordLoadFailure​(long loadTimeNanos)
        Record a failed load of a cache entry
        Parameters:
        loadTimeNanos - time used trying to load a cache entry
      • recordEvictions

        void recordEvictions​(int count)
        Record cache evictions due to the cache evictions strategy
        Parameters:
        count - number of evictions to record
      • recordOpenFiles

        void recordOpenFiles​(int delta)
        Record files opened by cache
        Parameters:
        delta - delta of number of files opened by cache
      • recordOpenBytes

        void recordOpenBytes​(PackFile pack,
                             int delta)
        Record cached bytes
        Parameters:
        pack - pack file the bytes are read from
        delta - delta of cached bytes
      • getStats

        @NonNull
        WindowCacheStats getStats()
        Returns a snapshot of this recorder's stats. Note that this may be an inconsistent view, as it may be interleaved with update operations.
        Returns:
        a snapshot of this recorder's stats