summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSalvatore Sanfilippo <antirez@gmail.com>2018-07-16 12:24:14 +0200
committerGitHub <noreply@github.com>2018-07-16 12:24:14 +0200
commit4215e74be5cfc0476982451e4aaa0ddf2a502548 (patch)
treeac340f75e7fbd84b5f4a347982dd8eafdd2f88b5
parentab33bcd34640306cdf70fd4fda0af41d93c687bf (diff)
parentb4ba5ac8408ef46c3a0b593a2d3cf6d74f33a1ce (diff)
downloadredis-4215e74be5cfc0476982451e4aaa0ddf2a502548.tar.gz
Merge pull request #5129 from soloestoy/xinfo-show-last-id
Streams: show last id for streams and groups
-rw-r--r--src/t_stream.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/t_stream.c b/src/t_stream.c
index 54d6b0d1f..c152bd678 100644
--- a/src/t_stream.c
+++ b/src/t_stream.c
@@ -2279,18 +2279,20 @@ NULL
raxSeek(&ri,"^",NULL,0);
while(raxNext(&ri)) {
streamCG *cg = ri.data;
- addReplyMultiBulkLen(c,6);
+ addReplyMultiBulkLen(c,8);
addReplyStatus(c,"name");
addReplyBulkCBuffer(c,ri.key,ri.key_len);
addReplyStatus(c,"consumers");
addReplyLongLong(c,raxSize(cg->consumers));
addReplyStatus(c,"pending");
addReplyLongLong(c,raxSize(cg->pel));
+ addReplyStatus(c,"last-delivered-id");
+ addReplyStreamID(c,&cg->last_id);
}
raxStop(&ri);
} else if (!strcasecmp(opt,"STREAM") && c->argc == 3) {
/* XINFO STREAM <key> (or the alias XINFO <key>). */
- addReplyMultiBulkLen(c,12);
+ addReplyMultiBulkLen(c,14);
addReplyStatus(c,"length");
addReplyLongLong(c,s->length);
addReplyStatus(c,"radix-tree-keys");
@@ -2299,6 +2301,8 @@ NULL
addReplyLongLong(c,s->rax->numnodes);
addReplyStatus(c,"groups");
addReplyLongLong(c,s->cgroups ? raxSize(s->cgroups) : 0);
+ addReplyStatus(c,"last-id");
+ addReplyStreamID(c,&s->last_id);
/* To emit the first/last entry we us the streamReplyWithRange()
* API. */