提交 09f66a0b 编写于 作者: A antirez

New client info field added to CLIENT LIST output: multi, containing the...

New client info field added to CLIENT LIST output: multi, containing the length of the current pipeline. Test modified accordingly.
上级 4cb8bb29
...@@ -1085,7 +1085,7 @@ sds getClientInfoString(redisClient *client) { ...@@ -1085,7 +1085,7 @@ sds getClientInfoString(redisClient *client) {
if (emask & AE_WRITABLE) *p++ = 'w'; if (emask & AE_WRITABLE) *p++ = 'w';
*p = '\0'; *p = '\0';
return sdscatprintf(sdsempty(), 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, ip,port,client->fd,
(long)(server.unixtime - client->ctime), (long)(server.unixtime - client->ctime),
(long)(server.unixtime - client->lastinteraction), (long)(server.unixtime - client->lastinteraction),
...@@ -1093,6 +1093,7 @@ sds getClientInfoString(redisClient *client) { ...@@ -1093,6 +1093,7 @@ sds getClientInfoString(redisClient *client) {
client->db->id, client->db->id,
(int) dictSize(client->pubsub_channels), (int) dictSize(client->pubsub_channels),
(int) listLength(client->pubsub_patterns), (int) listLength(client->pubsub_patterns),
(client->flags & REDIS_MULTI) ? client->mstate.count : -1,
(unsigned long) sdslen(client->querybuf), (unsigned long) sdslen(client->querybuf),
(unsigned long) sdsavail(client->querybuf), (unsigned long) sdsavail(client->querybuf),
(unsigned long) client->bufpos, (unsigned long) client->bufpos,
......
start_server {tags {"introspection"}} { start_server {tags {"introspection"}} {
test {CLIENT LIST} { test {CLIENT LIST} {
r 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*}
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册