提交 b80b1c59 编写于 作者: A antirez

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

上级 c1794728
......@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册