XINFO-STREAM(3valkey)
π XINFO-STREAM π
okay bestie, gather round, because this is the valkey command that's basically a stream's whole lore drop. it's xinfo-stream, and it tells you everything about what's going on inside a stream. no cap. π¦
β¨ SYNOPSIS β¨
XINFO STREAM key [FULL [COUNT count]]
πΈ DESCRIPTION πΈ
This command returns information about the stream stored at key. it's giving "tell me everything, don't leave a single crumb" energy. π
The informative details provided by this command are:
length: the number of entries in the stream (seeXLEN)radix-tree-keys: the number of keys in the underlying radix data structureradix-tree-nodes: the number of nodes in the underlying radix data structuregroups: the number of consumer groups defined for the streamlast-generated-id: the ID of the least-recently entry that was added to the streammax-deleted-entry-id: the maximal entry ID that was deleted from the streamentries-added: the count of all entries added to the stream during its lifetimefirst-entry: the ID and field-value tuples of the first entry in the streamlast-entry: the ID and field-value tuples of the last entry in the stream
π The FULL modifier π
The optional FULL modifier provides a more verbose reply. like, the director's cut. When provided, the FULL reply includes an entries array that consists of the stream entries (ID and field-value tuples) in ascending order. Furthermore, groups is also an array, and for each of the consumer groups it consists of the information reported by XINFO GROUPS and XINFO CONSUMERS. it's giving full transparency, we love to see it. β¨
The following information is provided for each of the groups:
name: the consumer group's namelast-delivered-id: the ID of the last entry delivered to the group's consumersentries-read: the logical "read counter" of the last entry delivered to the group's consumerslag: the number of entries in the stream that are still waiting to be delivered to the group's consumers, or aNULLwhen that number can't be determined.pel-count: the length of the group's pending entries list (PEL), which are messages that were delivered but are yet to be acknowledgedpending: an array with pending entries information (see below)consumers: an array with consumers information (see below)
The following information is provided for each pending entry:
- The ID of the message.
- The name of the consumer that fetched the message and has still to acknowledge it. We call it the current owner of the message.
- The UNIX timestamp of when the message was delivered to this consumer.
- The number of times this message was delivered.
The following information is provided for each consumer:
name: the consumer's nameseen-time: the UNIX timestamp of the last attempted interaction (Examples:XREADGROUP,XCLAIM,XAUTOCLAIM)active-time: the UNIX timestamp of the last successful interaction (Examples:XREADGROUPthat actually read some entries into the PEL,XCLAIM/XAUTOCLAIMthat actually claimed some entries)pel-count: the number of entries in the PEL: pending messages for the consumer, which are messages that were delivered but are yet to be acknowledgedpending: an array with pending entries information, has the same structure as described above, except the consumer name is omitted (redundant, since anyway we are in a specific consumer context)
heads up bestie π«Ά β note that before Redis OSS 7.2.0,seen-timeused to denote the last successful interaction. In 7.2.0,active-timewas added andseen-timewas changed to denote the last attempted interaction. so the vibes shifted, don't get caught slipping on old docs. π
The COUNT option can be used to limit the number of stream and PEL entries that are returned (The first count entries are returned). The default COUNT is 10 and a COUNT of 0 means that all entries will be returned (execution time may be long if the stream has a lot of entries). π so like, be careful with that 0, she's powerful.
π REPLY π
RESP2
One of the following:
valkey-protocol(7)Array reply: when theFULLargument was not given, a list of information about a stream in summary form.valkey-protocol(7)Array reply: when theFULLargument was given, a list of information about a stream in extended form.
RESP3
One of the following:
valkey-protocol(7)Map reply: when theFULLargument was not given, a list of information about a stream in summary form.valkey-protocol(7)Map reply: when theFULLargument was given, a list of information about a stream in extended form.
π₯ COMPLEXITY π₯
likeβ¦ constant time?? she ate and left no crumbs. π
π ACL CATEGORIES π
@read @slow @stream
π¦ HISTORY π¦
- Available since:
5.0.0 - Changed in
6.0.0: Added theFULLmodifier. - Changed in
7.0.0: Added themax-deleted-entry-id,entries-added,recorded-first-entry-id,entries-readandlagfields - Changed in
7.2.0: Added theactive-timefield, and changed the meaning ofseen-time.
π EXAMPLES π
Default reply:
> XINFO STREAM mystream
1) "length"
2) (integer) 2
3) "radix-tree-keys"
4) (integer) 1
5) "radix-tree-nodes"
6) (integer) 2
7) "last-generated-id"
8) "1638125141232-0"
9) "max-deleted-entry-id"
10) "0-0"
11) "entries-added"
12) (integer) 2
13) "groups"
14) (integer) 1
15) "first-entry"
16) 1) "1638125133432-0"
2) 1) "message"
2) "apple"
17) "last-entry"
18) 1) "1638125141232-0"
2) 1) "message"
2) "banana"
Full reply:
> XADD mystream * foo bar
"1638125133432-0"
> XADD mystream * foo bar2
"1638125141232-0"
> XGROUP CREATE mystream mygroup 0-0
OK
> XREADGROUP GROUP mygroup Alice COUNT 1 STREAMS mystream >
1) 1) "mystream"
2) 1) 1) "1638125133432-0"
2) 1) "foo"
2) "bar"
> XINFO STREAM mystream FULL
1) "length"
2) (integer) 2
3) "radix-tree-keys"
4) (integer) 1
5) "radix-tree-nodes"
6) (integer) 2
7) "last-generated-id"
8) "1638125141232-0"
9) "max-deleted-entry-id"
10) "0-0"
11) "entries-added"
12) (integer) 2
13) "entries"
14) 1) 1) "1638125133432-0"
2) 1) "foo"
2) "bar"
2) 1) "1638125141232-0"
2) 1) "foo"
2) "bar2"
15) "groups"
16) 1) 1) "name"
2) "mygroup"
3) "last-delivered-id"
4) "1638125133432-0"
5) "entries-read"
6) (integer) 1
7) "lag"
8) (integer) 1
9) "pel-count"
10) (integer) 1
11) "pending"
12) 1) 1) "1638125133432-0"
2) "Alice"
3) (integer) 1638125153423
4) (integer) 1
13) "consumers"
14) 1) 1) "name"
2) "Alice"
3) "seen-time"
4) (integer) 1638125133422
5) "active-time"
6) (integer) 1638125133432
7) "pel-count"
8) (integer) 1
9) "pending"
10) 1) 1) "1638125133432-0"
2) (integer) 1638125133432
3) (integer) 1
π SEE ALSO π
xack(3valkey), xadd(3valkey), xautoclaim(3valkey), xclaim(3valkey), xdel(3valkey), xgroup(3valkey), xgroup-create(3valkey), xgroup-createconsumer(3valkey), xgroup-delconsumer(3valkey), xgroup-destroy(3valkey), xgroup-help(3valkey), xgroup-setid(3valkey), xinfo(3valkey), xinfo-consumers(3valkey), xinfo-groups(3valkey), xinfo-help(3valkey), xlen(3valkey), xpending(3valkey), xrange(3valkey), xread(3valkey), xreadgroup(3valkey), xrevrange(3valkey), xsetid(3valkey), xtrim(3valkey)
and that's the whole page bestie!! π§ this one's from valkey version 9.0.0, dated 2025-10-21. go forth and XINFO STREAM responsibly, mwah πβ¨
π¦ where this page comes from
- fedora 44: valkey-doc 9.0.3-2.fc44 Β· CC-BY-SA-4.0
- fedora 44: valkey-doc 9.0.6-1.fc44 Β· CC-BY-SA-4.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms