Skip to content

Commit 7cfbe3c

Browse files
committed
Show failure queue length in queue:length command
1 parent 884939c commit 7cfbe3c

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

src/InEngine.Core/Queue/Broker.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,11 @@ public long GetPrimaryProcessingQueueLength()
114114
return Redis.ListLength(PrimaryProcessingQueueName);
115115
}
116116

117+
public long GetPrimaryFailedQueueLength()
118+
{
119+
return Redis.ListLength(PrimaryFailedQueueName);
120+
}
121+
117122
public bool ClearPrimaryWaitingQueue()
118123
{
119124
return Redis.KeyDelete(PrimaryWaitingQueueName);
@@ -136,6 +141,11 @@ public long GetSecondaryProcessingQueueLength()
136141
return Redis.ListLength(SecondaryProcessingQueueName);
137142
}
138143

144+
public long GetSecondaryFailedQueueLength()
145+
{
146+
return Redis.ListLength(SecondaryFailedQueueName);
147+
}
148+
139149
public bool ClearSecondaryWaitingQueue()
140150
{
141151
return Redis.KeyDelete(SecondaryWaitingQueueName);

src/InEngine.Core/Queue/Commands/GetLength.cs renamed to src/InEngine.Core/Queue/Commands/Length.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
namespace InEngine.Core.Queue.Commands
55
{
6-
public class GetLength : AbstractCommand
6+
public class Length : AbstractCommand
77
{
88
public override void Run()
99
{
@@ -14,13 +14,17 @@ public override void Run()
1414
Line(broker.GetPrimaryWaitingQueueLength().ToString().PadLeft(10));
1515
InfoText("In-progress".PadLeft(leftPadding));
1616
Line(broker.GetPrimaryProcessingQueueLength().ToString().PadLeft(10));
17+
ErrorText("Failed".PadLeft(leftPadding));
18+
Line(broker.GetPrimaryProcessingQueueLength().ToString().PadLeft(10));
1719
Newline();
1820

1921
Warning("Secondary Queue:");
2022
InfoText("Pending".PadLeft(leftPadding));
2123
Line(broker.GetSecondaryWaitingQueueLength().ToString().PadLeft(10));
2224
InfoText("In-progress".PadLeft(leftPadding));
2325
Line(broker.GetSecondaryProcessingQueueLength().ToString().PadLeft(10));
26+
ErrorText("Failed".PadLeft(leftPadding));
27+
Line(broker.GetSecondaryProcessingQueueLength().ToString().PadLeft(10));
2428
Newline();
2529
}
2630
}

src/InEngine.Core/Queue/Options.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ namespace InEngine.Core.Queue
77
public class Options : IOptions
88
{
99
[VerbOption("queue:publish", HelpText = "Publish a command message to a queue.")]
10-
public Publish QueuePublish { get; set; }
10+
public Publish Publish { get; set; }
1111

1212
[VerbOption("queue:consume", HelpText = "Consume one or more command messages from the queue.")]
13-
public Consume QueueConsume { get; set; }
13+
public Consume Consume { get; set; }
1414

1515
[VerbOption("queue:length", HelpText = "Get the number of messages in the primary and secondary queues.")]
16-
public GetLength QueueGetLength { get; set; }
16+
public Length Length { get; set; }
1717

1818
[VerbOption("queue:clear", HelpText = "Clear the primary and secondary queues.")]
1919
public ClearAll QueueClearAll { get; set; }

0 commit comments

Comments
 (0)