MCPcopy Create free account
hub / github.com/F-Stack/f-stack / estimateObjectIdleTime

Function estimateObjectIdleTime

app/redis-6.2.6/src/evict.c:91–99  ·  view source on GitHub ↗

Given an object returns the min number of milliseconds the object was never * requested, using an approximated LRU algorithm. */

Source from the content-addressed store, hash-verified

89/* Given an object returns the min number of milliseconds the object was never
90 * requested, using an approximated LRU algorithm. */
91unsigned long long estimateObjectIdleTime(robj *o) {
92 unsigned long long lruclock = LRU_CLOCK();
93 if (lruclock >= o->lru) {
94 return (lruclock - o->lru) * LRU_CLOCK_RESOLUTION;
95 } else {
96 return (lruclock + (LRU_CLOCK_MAX - o->lru)) *
97 LRU_CLOCK_RESOLUTION;
98 }
99}
100
101/* LRU approximation algorithm
102 *

Callers 5

evictionPoolPopulateFunction · 0.85
rdbSaveKeyValuePairFunction · 0.85
objectCommandFunction · 0.85
debugCommandFunction · 0.85
RM_GetLRUFunction · 0.85

Calls 1

LRU_CLOCKFunction · 0.85

Tested by

no test coverage detected