MCPcopy Create free account
hub / github.com/Snapchat/KeyDB / RM_GetLRU

Function RM_GetLRU

src/module.cpp:9042–9050  ·  view source on GitHub ↗

Gets the key last access time. * Value is idletime in milliseconds or -1 if the server's eviction policy is * LFU based. * returns REDISMODULE_OK if when key is valid. */

Source from the content-addressed store, hash-verified

9040 * LFU based.
9041 * returns REDISMODULE_OK if when key is valid. */
9042int RM_GetLRU(RedisModuleKey *key, mstime_t *lru_idle) {
9043 *lru_idle = -1;
9044 if (!key->value)
9045 return REDISMODULE_ERR;
9046 if (g_pserver->maxmemory_policy & MAXMEMORY_FLAG_LFU)
9047 return REDISMODULE_OK;
9048 *lru_idle = estimateObjectIdleTime(key->value);
9049 return REDISMODULE_OK;
9050}
9051
9052/* Set the key access frequency. only relevant if the server's maxmemory policy
9053 * is LFU based.

Callers

nothing calls this directly

Calls 1

estimateObjectIdleTimeFunction · 0.85

Tested by

no test coverage detected