From 2cb6828480300533e690d33cf824de8aa4f1ccd7 Mon Sep 17 00:00:00 2001 From: antirez Date: Thu, 30 Jun 2011 17:36:15 +0200 Subject: Added an unique ID field to every slow log entry. --- src/slowlog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/slowlog.c') diff --git a/src/slowlog.c b/src/slowlog.c index 17edf6159..cfd66dc63 100644 --- a/src/slowlog.c +++ b/src/slowlog.c @@ -26,6 +26,7 @@ slowlogEntry *slowlogCreateEntry(robj **argv, int argc, long long duration) { } se->time = time(NULL); se->duration = duration; + se->id = server.slowlog_entry_id++; return se; } @@ -47,6 +48,7 @@ void slowlogFreeEntry(void *septr) { * at server startup. */ void slowlogInit(void) { server.slowlog = listCreate(); + server.slowlog_entry_id = 0; listSetFreeMethod(server.slowlog,slowlogFreeEntry); } @@ -96,7 +98,8 @@ void slowlogCommand(redisClient *c) { int j; se = ln->value; - addReplyMultiBulkLen(c,3); + addReplyMultiBulkLen(c,4); + addReplyLongLong(c,se->id); addReplyLongLong(c,se->time); addReplyLongLong(c,se->duration); addReplyMultiBulkLen(c,se->argc); -- cgit v1.2.1