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
040e52c7
Commit
040e52c7
authored
Mar 21, 2019
by
Dvir Volk
Browse files
Renamed event name from "miss" to "keymiss"
parent
bc269c85
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/db.c
View file @
040e52c7
...
...
@@ -83,7 +83,7 @@ robj *lookupKey(redisDb *db, robj *key, int flags) {
* 1. A key gets expired if it reached it's TTL.
* 2. The key last access time is updated.
* 3. The global keys hits/misses stats are updated (reported in INFO).
* 4. If keyspace notifications are enabled, a "miss" notification is fired.
* 4. If keyspace notifications are enabled, a "
key
miss" notification is fired.
*
* This API should not be used when we write to the key after obtaining
* the object linked to the key, but only for read only operations.
...
...
@@ -107,7 +107,7 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
* to return NULL ASAP. */
if
(
server
.
masterhost
==
NULL
)
{
server
.
stat_keyspace_misses
++
;
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"miss"
,
key
,
db
->
id
);
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"
key
miss"
,
key
,
db
->
id
);
return
NULL
;
}
...
...
@@ -129,14 +129,14 @@ robj *lookupKeyReadWithFlags(redisDb *db, robj *key, int flags) {
server
.
current_client
->
cmd
->
flags
&
CMD_READONLY
)
{
server
.
stat_keyspace_misses
++
;
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"miss"
,
key
,
db
->
id
);
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"
key
miss"
,
key
,
db
->
id
);
return
NULL
;
}
}
val
=
lookupKey
(
db
,
key
,
flags
);
if
(
val
==
NULL
)
{
server
.
stat_keyspace_misses
++
;
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"miss"
,
key
,
db
->
id
);
notifyKeyspaceEvent
(
NOTIFY_KEY_MISS
,
"
key
miss"
,
key
,
db
->
id
);
}
else
server
.
stat_keyspace_hits
++
;
...
...
src/modules/testmodule.c
View file @
040e52c7
...
...
@@ -188,7 +188,7 @@ int TestNotifications(RedisModuleCtx *ctx, RedisModuleString **argv, int argc) {
RedisModule_Call
(
ctx
,
"LPUSH"
,
"cc"
,
"l"
,
"y"
);
RedisModule_Call
(
ctx
,
"LPUSH"
,
"cc"
,
"l"
,
"y"
);
/* Miss some keys intentionally so we will get a "miss" notification. */
/* Miss some keys intentionally so we will get a "
key
miss" notification. */
RedisModule_Call
(
ctx
,
"GET"
,
"c"
,
"nosuchkey"
);
RedisModule_Call
(
ctx
,
"SMEMBERS"
,
"c"
,
"nosuchkey"
);
...
...
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