feat(streams): support entries_read and lag for XINFO GROUPS (#1952)

entries_read and lag have been added to the output of XINFO GROUPS since Redis 7.0. This patch supports both for Dragonfly. This patch also fixes a bug that incorrectly sets the initial value of entries_read when a consumer group is created.

fixes #1948
This commit is contained in:
Yue Li 2023-09-28 01:35:19 -07:00 committed by GitHub
parent 5c9c9255d2
commit a2457e3410
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 5 deletions

View file

@ -157,9 +157,9 @@ TEST_F(RdbTest, Stream) {
EXPECT_THAT(resp, ArrLen(2));
resp = Run({"xinfo", "groups", "key:1"}); // test dereferences array of size 1
EXPECT_THAT(resp, ArrLen(8));
EXPECT_THAT(resp.GetVec(), ElementsAre("name", "g2", "consumers", IntArg(0), "pending", IntArg(0),
"last-delivered-id", "1655444851523-1"));
EXPECT_THAT(resp, RespArray(ElementsAre("name", "g2", "consumers", IntArg(0), "pending",
IntArg(0), "last-delivered-id", "1655444851523-1",
"entries-read", IntArg(0), "lag", IntArg(0))));
resp = Run({"xinfo", "groups", "key:2"});
EXPECT_THAT(resp, ArrLen(0));