}
se->time = time(NULL);
se->duration = duration;
+ se->id = server.slowlog_entry_id++;
return se;
}
* at server startup. */
void slowlogInit(void) {
server.slowlog = listCreate();
+ server.slowlog_entry_id = 0;
listSetFreeMethod(server.slowlog,slowlogFreeEntry);
}
* configured max length. */
void slowlogPushEntryIfNeeded(robj **argv, int argc, long long duration) {
if (server.slowlog_log_slower_than < 0) return; /* Slowlog disabled */
- if (duration > server.slowlog_log_slower_than)
+ if (duration >= server.slowlog_log_slower_than)
listAddNodeHead(server.slowlog,slowlogCreateEntry(argv,argc,duration));
/* Remove old entries if needed. */
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);