@@ -34,7 +34,6 @@ public class RedisClient : IQueueClient
3434 public ConnectionMultiplexer _connectionMultiplexer ;
3535 public IDatabase Redis { get { return Connection . GetDatabase ( ClientSettings . Database ) ; } }
3636 public bool UseCompression { get ; set ; }
37-
3837 public RedisChannel RedisChannel { get ; set ; }
3938
4039 public void InitChannel ( )
@@ -135,21 +134,6 @@ public ICommandEnvelope Consume()
135134 return commandEnvelope ;
136135 }
137136
138- public long GetPendingQueueLength ( )
139- {
140- return Redis . ListLength ( PendingQueueName ) ;
141- }
142-
143- public long GetInProgressQueueLength ( )
144- {
145- return Redis . ListLength ( InProgressQueueName ) ;
146- }
147-
148- public long GetFailedQueueLength ( )
149- {
150- return Redis . ListLength ( FailedQueueName ) ;
151- }
152-
153137 public bool ClearPendingQueue ( )
154138 {
155139 return Redis . KeyDelete ( PendingQueueName ) ;
@@ -191,5 +175,14 @@ public List<ICommandEnvelope> GetMessages(string queueName, long from, long to)
191175 . ToStringArray ( )
192176 . Select ( x => x . DeserializeFromJson < CommandEnvelope > ( ) as ICommandEnvelope ) . ToList ( ) ;
193177 }
178+
179+ public Dictionary < string , long > GetQueueLengths ( )
180+ {
181+ return new Dictionary < string , long > {
182+ { "Pending" , Redis . ListLength ( PendingQueueName ) } ,
183+ { "In-progress" , Redis . ListLength ( InProgressQueueName ) } ,
184+ { "Failed" , Redis . ListLength ( FailedQueueName ) }
185+ } ;
186+ }
194187 }
195188}
0 commit comments