github.com/bingoohuang/gg@v0.0.0-20240325092523-45da7dee9335/pkg/ttlcache/metrics.go (about) 1 package ttlcache 2 3 // Metrics contains common cache metrics calculated over the course 4 // of the cache's lifetime. 5 type Metrics struct { 6 // Insertions specifies how many items were inserted. 7 Insertions uint64 8 9 // Hits specifies how many items were successfully retrieved 10 // from the cache. 11 // Retrievals made with a loader function are not tracked. 12 Hits uint64 13 14 // Misses specifies how many items were not found in the cache. 15 // Retrievals made with a loader function are tracked as well. 16 Misses uint64 17 18 // Evictions specifies how many items were removed from the 19 // cache. 20 Evictions uint64 21 }