33class PersistentStringCacheImpl;
34class PersistentStringCacheStats;
77 int64_t
size() const noexcept;
92 int64_t
hits() const noexcept;
242 std::shared_ptr<internal::PersistentStringCacheStats const> p_;
246 friend class internal::PersistentStringCacheImpl;
Class that provides (read-only) access to cache statistics and settings.
Definition persistent_cache_stats.h:43
int64_t longest_miss_run() const noexcept
Returns the largest number of consecutive misses.
static constexpr unsigned NUM_BINS
The number of bins in a histogram.
Definition persistent_cache_stats.h:214
PersistentCacheStats(PersistentCacheStats const &)
std::chrono::system_clock::time_point most_recent_miss_time() const noexcept
Returns the timestamp of the most recent miss.
int64_t hit_runs() const noexcept
Returns the number of hit runs.
int64_t hits() const noexcept
Returns the number of hits since the statistics were last reset.
int64_t hits_since_last_miss() const noexcept
Returns the number of consecutive hits since the last miss.
CacheDiscardPolicy policy() const noexcept
Returns the discard policy (lru_only or lru_ttl).
std::chrono::system_clock::time_point longest_hit_run_time() const noexcept
Returns the time of the longest hit run.
static HistogramBounds const & histogram_bounds() noexcept
Returns the bounds for each bin a histogram.
int64_t max_size_in_bytes() const noexcept
Returns the maximum size of the cache.
int64_t size_in_bytes() const noexcept
Returns the size of all entries (including expired ones).
PersistentCacheStats(PersistentCacheStats &&) noexcept
Histogram const & histogram() const noexcept
Returns a histogram for the entries in the cache.
int64_t misses() const noexcept
Returns the number of misses since the statistics were last reset.
std::vector< std::pair< int32_t, int32_t > > HistogramBounds
Lower and upper bounds for the bins in the histogram.
Definition persistent_cache_stats.h:209
double avg_hit_run_length() const noexcept
Returns a rolling average of the hit run length.
std::string cache_path() const
Returns the path to the cache directory.
std::vector< uint32_t > Histogram
Histogram of the size distribution of cache entries.
Definition persistent_cache_stats.h:201
int64_t ttl_evictions() const noexcept
Returns the number of entries that were evicted due to being expired.
std::chrono::system_clock::time_point most_recent_hit_time() const noexcept
Returns the timestamp of the most recent hit.
int64_t size() const noexcept
Returns the number of entries (including expired ones).
std::chrono::system_clock::time_point longest_miss_run_time() const noexcept
Returns the time of the longest miss run.
int64_t longest_hit_run() const noexcept
Returns the largest number of consecutive hits.
int64_t miss_runs() const noexcept
Returns the number of miss runs.
double avg_miss_run_length() const noexcept
Returns a rolling average of the miss run length.
int64_t misses_since_last_hit() const noexcept
Returns the number of consecutive misses since the last hit.
int64_t lru_evictions() const noexcept
Returns the number of entries that were evicted due to being least recently used.
Top-level namespace for core functionality.
Definition cache_codec.h:24
CacheDiscardPolicy
Indicates the discard policy to make room for entries when the cache is full.
Definition cache_discard_policy.h:36