XINFO STREAM

Syntax

  1. XINFO STREAM key [FULL [COUNT count]]

ACL categories: @read, @stream, @slow

XINFO STREAM command returns information about the stream stored at <key>.

The informative details provided by this command are:

  • length: the number of entries in the stream (see XLEN)
  • radix-tree-keys: the number of keys in the underlying radix data structure
  • radix-tree-nodes: the number of nodes in the underlying radix data structure
  • groups: the number of consumer groups defined for the stream
  • last-generated-id: the ID of the least-recently entry that was added to the stream
  • max-deleted-entry-id: the maximal entry ID that was deleted from the stream
  • entries-added: the count of all entries added to the stream during its lifetime
  • first-entry: the ID and field-value tuples of the first entry in the stream
  • last-entry: the ID and field-value tuples of the last entry in the stream

The optional FULL modifier provides a more verbose reply. 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.

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).

Return

Array reply: a list of informational bits.

Example

  1. dragonfly> XINFO STREAM mystream
  2. 1) "length"
  3. 2) (integer) 2
  4. 3) "radix-tree-keys"
  5. 4) (integer) 1
  6. 5) "radix-tree-nodes"
  7. 6) (integer) 2
  8. 7) "last-generated-id"
  9. 8) "1638125141232-0"
  10. 9) "max-deleted-entry-id"
  11. 10) "0-0"
  12. 11) "entries-added"
  13. 12) (integer) 2
  14. 13) "groups"
  15. 14) (integer) 1
  16. 15) "first-entry"
  17. 16) 1) "1638125133432-0"
  18. 2) 1) "message"
  19. 2) "apple"
  20. 17) "last-entry"
  21. 18) 1) "1638125141232-0"
  22. 2) 1) "message"
  23. 2) "banana"

Full reply:

  1. dragonfly> XADD mystream * foo bar
  2. "1638125133432-0"
  3. dragonfly> XADD mystream * foo bar2
  4. "1638125141232-0"
  5. dragonfly> XGROUP CREATE mystream mygroup 0-0
  6. OK
  7. dragonfly> XREADGROUP GROUP mygroup Alice COUNT 1 STREAMS mystream >
  8. 1) 1) "mystream"
  9. 2) 1) 1) "1638125133432-0"
  10. 2) 1) "foo"
  11. 2) "bar"
  12. dragonfly> XINFO STREAM mystream FULL
  13. 1) "length"
  14. 2) (integer) 2
  15. 3) "radix-tree-keys"
  16. 4) (integer) 1
  17. 5) "radix-tree-nodes"
  18. 6) (integer) 2
  19. 7) "last-generated-id"
  20. 8) "1638125141232-0"
  21. 9) "max-deleted-entry-id"
  22. 10) "0-0"
  23. 11) "entries-added"
  24. 12) (integer) 2
  25. 13) "entries"
  26. 14) 1) 1) "1638125133432-0"
  27. 2) 1) "foo"
  28. 2) "bar"
  29. 2) 1) "1638125141232-0"
  30. 2) 1) "foo"
  31. 2) "bar2"
  32. 15) "groups"
  33. 16) 1) 1) "name"
  34. 2) "mygroup"
  35. 3) "last-delivered-id"
  36. 4) "1638125133432-0"
  37. 5) "entries-read"
  38. 6) (integer) 1
  39. 7) "lag"
  40. 8) (integer) 1
  41. 9) "pel-count"
  42. 10) (integer) 1
  43. 11) "pending"
  44. 12) 1) 1) "1638125133432-0"
  45. 2) "Alice"
  46. 3) (integer) 1638125153423
  47. 4) (integer) 1
  48. 13) "consumers"
  49. 14) 1) 1) "name"
  50. 2) "Alice"
  51. 3) "seen-time"
  52. 4) (integer) 1638125133422
  53. 5) "active-time"
  54. 6) (integer) 1638125133432
  55. 7) "pel-count"
  56. 8) (integer) 1
  57. 9) "pending"
  58. 10) 1) 1) "1638125133432-0"
  59. 2) (integer) 1638125133432
  60. 3) (integer) 1