XINFO STREAM
XINFO STREAM key [FULL [COUNT count]]
- Group
- Stream
- Complexity
- O(1), or O(N) with FULL for the entries and pending entries returned
- Arity
- -3 (at least 3 words, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
XINFO STREAM reports on the stream at key.
Fields
Section titled “Fields”| Field | Meaning |
|---|---|
length |
Number of entries. |
radix-tree-keys, radix-tree-nodes |
Compatibility fields for clients that read them. The values can differ from Redis. |
last-generated-id |
The highest ID ever given to an entry. |
max-deleted-entry-id |
The highest ID ever deleted (0-0 if none). |
entries-added |
Entries ever added, including deleted ones. |
recorded-first-entry-id |
The ID of the first entry (0-0 when empty). |
idmp-duration, idmp-maxsize |
How long, in seconds, and how many idempotent IDs the stream keeps for each producer (set with XCFGSET). |
pids-tracked, iids-tracked |
Producers and idempotent IDs the stream holds now. |
iids-added, iids-duplicates |
Entries added with an idempotent ID, and adds that XADD turned away because the ID was already known. |
groups |
Number of consumer groups. |
first-entry, last-entry |
The first and last entries as [id, [field, value, ...]], or nil when the stream is empty. |
Options
Section titled “Options”| Option | Effect |
|---|---|
FULL |
Replace groups, first-entry and last-entry with entries (the entries in ID order) and groups (each group with its pending entries and consumers). |
COUNT count |
With FULL, the most entries, and pending entries per group and per consumer, to show. Default 10; 0 or less shows all. |
With FULL, each group has name, last-delivered-id, entries-read,
lag, pel-count, pending (each [id, consumer, delivery-time, delivery-count])
and consumers. Each consumer has name, seen-time, active-time,
pel-count and pending (each [id, delivery-time, delivery-count]). Times
are Unix times in milliseconds. active-time is -1 for a consumer that has
not yet received entries from XREADGROUP or claimed any.
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Stream exists | Flat array of field names and values | Map |
Error replies:
ERR no such keywhen the stream does not exist.ERR unknown subcommand or wrong number of arguments for 'STREAM'. Try XINFO HELP.for anything other thanFULL [COUNT count].ERR value is not an integer or out of rangefor a bad count, andWRONGTYPE.
Examples
Section titled “Examples”127.0.0.1:6379> XADD tasks 1700000000000-0 job email"1700000000000-0"127.0.0.1:6379> XADD tasks 1700000000001-0 job sms"1700000000001-0"127.0.0.1:6379> XGROUP CREATE tasks workers 0OK127.0.0.1:6379> XINFO STREAM tasks 1) "length" 2) (integer) 2 3) "radix-tree-keys" 4) (integer) 1 5) "radix-tree-nodes" 6) (integer) 1 7) "last-generated-id" 8) "1700000000001-0" 9) "max-deleted-entry-id"10) "0-0"11) "entries-added"12) (integer) 213) "recorded-first-entry-id"14) "1700000000000-0"15) "idmp-duration"16) (integer) 10017) "idmp-maxsize"18) (integer) 10019) "pids-tracked"20) (integer) 021) "iids-tracked"22) (integer) 023) "iids-added"24) (integer) 025) "iids-duplicates"26) (integer) 027) "groups"28) (integer) 129) "first-entry"30) 1) "1700000000000-0" 2) 1) "job" 2) "email"31) "last-entry"32) 1) "1700000000001-0" 2) 1) "job" 2) "sms"Compatibility
Section titled “Compatibility”Same fields as Redis 7.2 and Valkey 8, plus the idempotent-producer fields of
Redis 8.6. In the FULL form, seen-time is when the consumer was last seen (made,
read or claimed) and active-time is when it last received or claimed
entries, -1 if never.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.