]> git.saurik.com Git - redis.git/commitdiff
New client info field added to CLIENT LIST output: multi, containing the length of...
authorantirez <antirez@gmail.com>
Sat, 7 Apr 2012 09:14:52 +0000 (11:14 +0200)
committerantirez <antirez@gmail.com>
Sat, 7 Apr 2012 09:14:52 +0000 (11:14 +0200)
src/networking.c
tests/unit/introspection.tcl

index 75f6cf2213cb8b83f8488d01eadee13f85474d66..f922e2975133d0deaf438c633a06a03dddc41855 100644 (file)
@@ -1085,7 +1085,7 @@ sds getClientInfoString(redisClient *client) {
     if (emask & AE_WRITABLE) *p++ = 'w';
     *p = '\0';
     return sdscatprintf(sdsempty(),
-        "addr=%s:%d fd=%d age=%ld idle=%ld flags=%s db=%d sub=%d psub=%d qbuf=%lu qbuf-free=%lu obl=%lu oll=%lu omem=%lu events=%s cmd=%s",
+        "addr=%s:%d fd=%d age=%ld idle=%ld flags=%s db=%d sub=%d psub=%d multi=%d qbuf=%lu qbuf-free=%lu obl=%lu oll=%lu omem=%lu events=%s cmd=%s",
         ip,port,client->fd,
         (long)(server.unixtime - client->ctime),
         (long)(server.unixtime - client->lastinteraction),
@@ -1093,6 +1093,7 @@ sds getClientInfoString(redisClient *client) {
         client->db->id,
         (int) dictSize(client->pubsub_channels),
         (int) listLength(client->pubsub_patterns),
+        (client->flags & REDIS_MULTI) ? client->mstate.count : -1,
         (unsigned long) sdslen(client->querybuf),
         (unsigned long) sdsavail(client->querybuf),
         (unsigned long) client->bufpos,
index a768e2ab98b8c821b0d11db7437073e5d07ee11c..773df112700117043340a1b639ab1951a59d5d17 100644 (file)
@@ -1,5 +1,5 @@
 start_server {tags {"introspection"}} {
     test {CLIENT LIST} {
         r client list
-    } {*addr=*:* fd=* age=* idle=* flags=N db=9 sub=0 psub=0 qbuf=0 qbuf-free=* obl=0 oll=0 omem=0 events=r cmd=client*}
+    } {*addr=*:* fd=* age=* idle=* flags=N db=9 sub=0 psub=0 multi=-1 qbuf=0 qbuf-free=* obl=0 oll=0 omem=0 events=r cmd=client*}
 }