summaryrefslogtreecommitdiff
path: root/src/slowlog.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/slowlog.c')
-rw-r--r--src/slowlog.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/slowlog.c b/src/slowlog.c
index 32ec4374c..9d6f4f02d 100644
--- a/src/slowlog.c
+++ b/src/slowlog.c
@@ -140,7 +140,15 @@ void slowlogReset(void) {
/* The SLOWLOG command. Implements all the subcommands needed to handle the
* Redis slow log. */
void slowlogCommand(client *c) {
- if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) {
+ if (!strcasecmp(c->argv[1]->ptr,"help") && c->argc == 2) {
+ const char *help[] = {
+ "get [count] -- Return the top entries from the slowlog (default: 10).",
+ "len -- Return the length of the slowlog.",
+ "reset -- Reset the slowlog.",
+ NULL
+ };
+ addReplyHelp(c, help);
+ } else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"reset")) {
slowlogReset();
addReply(c,shared.ok);
} else if (c->argc == 2 && !strcasecmp(c->argv[1]->ptr,"len")) {
@@ -177,7 +185,8 @@ void slowlogCommand(client *c) {
}
setDeferredMultiBulkLength(c,totentries,sent);
} else {
- addReplyError(c,
- "Unknown SLOWLOG subcommand or wrong # of args. Try GET, RESET, LEN.");
+ addReplyErrorFormat(c, "Unknown subcommand or wrong number of arguments for '%s'. Try SLOWLOG help",
+ (char*)c->argv[1]->ptr);
+ return;
}
}