Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
b80b1c59
Commit
b80b1c59
authored
Feb 01, 2012
by
antirez
Browse files
Only incremnet stats for key miss/hit when the key is semantically accessed in read-only.
parent
c1794728
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
b80b1c59
...
...
@@ -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
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment