size_t stat_peak_memory; /* max used memory record */
long long stat_fork_time; /* time needed to perform latets fork() */
list *slowlog;
+ long long slowlog_entry_id;
long long slowlog_log_slower_than;
unsigned long slowlog_max_len;
/* Configuration */
}
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);
}
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);
typedef struct slowlogEntry {
robj **argv;
int argc;
+ long long id; /* Unique entry identifier. */
long long duration; /* Time spent by the query, in nanoseconds. */
time_t time; /* Unix time at which the query was executed. */
} slowlogEntry;