mirror of
https://github.com/fluencelabs/redis
synced 2025-06-12 08:41:21 +00:00
Hide HELLO and AUTH from slowlog and monitor
This commit is contained in:
13
src/server.c
13
src/server.c
@ -146,6 +146,8 @@ volatile unsigned long lru_clock; /* Server global current LRU time. */
|
||||
* in this condition but just a few.
|
||||
*
|
||||
* no-monitor: Do not automatically propagate the command on MONITOR.
|
||||
*
|
||||
* no-slowlog: Do not automatically propagate the command to the slowlog.
|
||||
*
|
||||
* cluster-asking: Perform an implicit ASKING for this command, so the
|
||||
* command will be accepted in cluster mode if the slot is marked
|
||||
@ -627,7 +629,7 @@ struct redisCommand redisCommandTable[] = {
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
{"auth",authCommand,-2,
|
||||
"no-script ok-loading ok-stale fast @connection",
|
||||
"no-script ok-loading ok-stale fast no-monitor no-slowlog @connection",
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
/* We don't allow PING during loading since in Redis PING is used as
|
||||
@ -670,7 +672,7 @@ struct redisCommand redisCommandTable[] = {
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
{"exec",execCommand,1,
|
||||
"no-script no-monitor @transaction",
|
||||
"no-script no-monitor no-slowlog @transaction",
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
{"discard",discardCommand,1,
|
||||
@ -822,7 +824,7 @@ struct redisCommand redisCommandTable[] = {
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
{"hello",helloCommand,-2,
|
||||
"no-script fast @connection",
|
||||
"no-script fast no-monitor no-slowlog @connection",
|
||||
0,NULL,0,0,0,0,0,0},
|
||||
|
||||
/* EVAL can modify the dataset, however it is not flagged as a write
|
||||
@ -2902,6 +2904,8 @@ int populateCommandTableParseFlags(struct redisCommand *c, char *strflags) {
|
||||
c->flags |= CMD_STALE;
|
||||
} else if (!strcasecmp(flag,"no-monitor")) {
|
||||
c->flags |= CMD_SKIP_MONITOR;
|
||||
} else if (!strcasecmp(flag,"no-slowlog")) {
|
||||
c->flags |= CMD_SKIP_SLOWLOG;
|
||||
} else if (!strcasecmp(flag,"cluster-asking")) {
|
||||
c->flags |= CMD_ASKING;
|
||||
} else if (!strcasecmp(flag,"fast")) {
|
||||
@ -3186,7 +3190,7 @@ void call(client *c, int flags) {
|
||||
|
||||
/* Log the command into the Slow log if needed, and populate the
|
||||
* per-command statistics that we show in INFO commandstats. */
|
||||
if (flags & CMD_CALL_SLOWLOG && c->cmd->proc != execCommand) {
|
||||
if (flags & CMD_CALL_SLOWLOG && !(c->flags & CMD_SKIP_SLOWLOG)) {
|
||||
char *latency_event = (c->cmd->flags & CMD_FAST) ?
|
||||
"fast-command" : "command";
|
||||
latencyAddSampleIfNeeded(latency_event,duration/1000);
|
||||
@ -3677,6 +3681,7 @@ void addReplyCommand(client *c, struct redisCommand *cmd) {
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_LOADING, "loading");
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_STALE, "stale");
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_SKIP_MONITOR, "skip_monitor");
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_SKIP_SLOWLOG, "skip_slowlog");
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_ASKING, "asking");
|
||||
flagcount += addReplyCommandFlag(c,cmd,CMD_FAST, "fast");
|
||||
if ((cmd->getkeys_proc && !(cmd->flags & CMD_MODULE)) ||
|
||||
|
Reference in New Issue
Block a user