mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
Only incremnet stats for key miss/hit when the key is semantically accessed in read-only.
This commit is contained in:
parent
c17947287a
commit
b80b1c5914
11
src/db.c
11
src/db.c
@ -42,17 +42,22 @@ robj *lookupKey(redisDb *db, robj *key) {
|
||||
* a copy on write madness. */
|
||||
if (server.rdb_child_pid == -1 && server.aof_child_pid == -1)
|
||||
val->lru = server.lruclock;
|
||||
server.stat_keyspace_hits++;
|
||||
return val;
|
||||
} else {
|
||||
server.stat_keyspace_misses++;
|
||||
return NULL;
|
||||
}
|
||||
}
|
||||
|
||||
robj *lookupKeyRead(redisDb *db, robj *key) {
|
||||
robj *val;
|
||||
|
||||
expireIfNeeded(db,key);
|
||||
return lookupKey(db,key);
|
||||
val = lookupKey(db,key);
|
||||
if (val == NULL)
|
||||
server.stat_keyspace_misses++;
|
||||
else
|
||||
server.stat_keyspace_hits++;
|
||||
return val;
|
||||
}
|
||||
|
||||
robj *lookupKeyWrite(redisDb *db, robj *key) {
|
||||
|
Loading…
Reference in New Issue
Block a user