|
PACS System 0.1.0
PACS DICOM system library
|
Statistics for cache performance monitoring. More...
#include <simple_lru_cache.h>

Public Member Functions | |
| double | hit_rate () const noexcept |
| Calculate the cache hit rate. | |
| std::uint64_t | total_accesses () const noexcept |
| Get total number of cache accesses (hits + misses) | |
| void | reset () noexcept |
| Reset all statistics to zero. | |
Public Attributes | |
| std::atomic< std::uint64_t > | hits {0} |
| Number of cache hits. | |
| std::atomic< std::uint64_t > | misses {0} |
| Number of cache misses. | |
| std::atomic< std::uint64_t > | insertions {0} |
| Number of insertions. | |
| std::atomic< std::uint64_t > | evictions {0} |
| Number of LRU evictions. | |
| std::atomic< std::uint64_t > | expirations {0} |
| Number of TTL expirations. | |
| std::atomic< std::size_t > | current_size {0} |
| Current number of entries. | |
Statistics for cache performance monitoring.
All counters are atomic to allow lock-free reading of statistics while the cache is being modified.
Definition at line 78 of file simple_lru_cache.h.
|
inlinenodiscardnoexcept |
Calculate the cache hit rate.
Definition at line 90 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::query_cache::hit_rate(), and kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::hit_rate().

|
inlinenoexcept |
Reset all statistics to zero.
Definition at line 112 of file simple_lru_cache.h.
References evictions, expirations, hits, insertions, and misses.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::reset_stats().

|
inlinenodiscardnoexcept |
Get total number of cache accesses (hits + misses)
Definition at line 104 of file simple_lru_cache.h.
| std::atomic<std::size_t> kcenon::pacs::services::cache::cache_stats::current_size {0} |
Current number of entries.
Definition at line 84 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::clear(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::evict_oldest(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::invalidate_if(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::purge_expired(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::put(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::put(), and kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::remove_entry().
| std::atomic<std::uint64_t> kcenon::pacs::services::cache::cache_stats::evictions {0} |
Number of LRU evictions.
Definition at line 82 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::evict_oldest(), and reset().
| std::atomic<std::uint64_t> kcenon::pacs::services::cache::cache_stats::expirations {0} |
Number of TTL expirations.
Definition at line 83 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::get(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::purge_expired(), and reset().
| std::atomic<std::uint64_t> kcenon::pacs::services::cache::cache_stats::hits {0} |
Number of cache hits.
Definition at line 79 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::get(), hit_rate(), reset(), and total_accesses().
| std::atomic<std::uint64_t> kcenon::pacs::services::cache::cache_stats::insertions {0} |
Number of insertions.
Definition at line 81 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::put(), kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::put(), and reset().
| std::atomic<std::uint64_t> kcenon::pacs::services::cache::cache_stats::misses {0} |
Number of cache misses.
Definition at line 80 of file simple_lru_cache.h.
Referenced by kcenon::pacs::services::cache::simple_lru_cache< Key, Value, Hash, KeyEqual >::get(), hit_rate(), reset(), and total_accesses().