Only incremnet stats for key miss/hit when the key is semantically accessed in read-only.

This commit is contained in:
antirez 2012-02-01 21:47:41 +01:00
parent c17947287a
commit b80b1c5914

View File

@ -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) {