@@ -1892,9 +1892,10 @@ type XInfoConsumersCmd struct {
1892
1892
}
1893
1893
1894
1894
type XInfoConsumer struct {
1895
- Name string
1896
- Pending int64
1897
- Idle time.Duration
1895
+ Name string
1896
+ Pending int64
1897
+ Idle time.Duration
1898
+ Inactive time.Duration
1898
1899
}
1899
1900
1900
1901
var _ Cmder = (* XInfoConsumersCmd )(nil )
@@ -1932,12 +1933,13 @@ func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error {
1932
1933
cmd .val = make ([]XInfoConsumer , n )
1933
1934
1934
1935
for i := 0 ; i < len (cmd .val ); i ++ {
1935
- if err = rd .ReadFixedMapLen (3 ); err != nil {
1936
+ nn , err := rd .ReadMapLen ()
1937
+ if err != nil {
1936
1938
return err
1937
1939
}
1938
1940
1939
1941
var key string
1940
- for f := 0 ; f < 3 ; f ++ {
1942
+ for f := 0 ; f < nn ; f ++ {
1941
1943
key , err = rd .ReadString ()
1942
1944
if err != nil {
1943
1945
return err
@@ -1952,6 +1954,10 @@ func (cmd *XInfoConsumersCmd) readReply(rd *proto.Reader) error {
1952
1954
var idle int64
1953
1955
idle , err = rd .ReadInt ()
1954
1956
cmd .val [i ].Idle = time .Duration (idle ) * time .Millisecond
1957
+ case "inactive" :
1958
+ var inactive int64
1959
+ inactive , err = rd .ReadInt ()
1960
+ cmd .val [i ].Inactive = time .Duration (inactive ) * time .Millisecond
1955
1961
default :
1956
1962
return fmt .Errorf ("redis: unexpected content %s in XINFO CONSUMERS reply" , key )
1957
1963
}
@@ -2226,10 +2232,11 @@ type XInfoStreamGroupPending struct {
2226
2232
}
2227
2233
2228
2234
type XInfoStreamConsumer struct {
2229
- Name string
2230
- SeenTime time.Time
2231
- PelCount int64
2232
- Pending []XInfoStreamConsumerPending
2235
+ Name string
2236
+ SeenTime time.Time
2237
+ ActiveTime time.Time
2238
+ PelCount int64
2239
+ Pending []XInfoStreamConsumerPending
2233
2240
}
2234
2241
2235
2242
type XInfoStreamConsumerPending struct {
@@ -2452,13 +2459,14 @@ func readXInfoStreamConsumers(rd *proto.Reader) ([]XInfoStreamConsumer, error) {
2452
2459
consumers := make ([]XInfoStreamConsumer , 0 , n )
2453
2460
2454
2461
for i := 0 ; i < n ; i ++ {
2455
- if err = rd .ReadFixedMapLen (4 ); err != nil {
2462
+ nn , err := rd .ReadMapLen ()
2463
+ if err != nil {
2456
2464
return nil , err
2457
2465
}
2458
2466
2459
2467
c := XInfoStreamConsumer {}
2460
2468
2461
- for f := 0 ; f < 4 ; f ++ {
2469
+ for f := 0 ; f < nn ; f ++ {
2462
2470
cKey , err := rd .ReadString ()
2463
2471
if err != nil {
2464
2472
return nil , err
@@ -2472,7 +2480,13 @@ func readXInfoStreamConsumers(rd *proto.Reader) ([]XInfoStreamConsumer, error) {
2472
2480
if err != nil {
2473
2481
return nil , err
2474
2482
}
2475
- c .SeenTime = time .Unix (seen / 1000 , seen % 1000 * int64 (time .Millisecond ))
2483
+ c .SeenTime = time .UnixMilli (seen )
2484
+ case "active-time" :
2485
+ active , err := rd .ReadInt ()
2486
+ if err != nil {
2487
+ return nil , err
2488
+ }
2489
+ c .ActiveTime = time .UnixMilli (active )
2476
2490
case "pel-count" :
2477
2491
c .PelCount , err = rd .ReadInt ()
2478
2492
case "pending" :
0 commit comments