Change HttpStress app to highlight in red unchanged totals (dotnet/corefx#39576)
authorStephen Toub <stoub@microsoft.com>
Wed, 17 Jul 2019 21:53:30 +0000 (17:53 -0400)
committerGitHub <noreply@github.com>
Wed, 17 Jul 2019 21:53:30 +0000 (17:53 -0400)
When no additional operations have completed since the last time status was output, highlight that in red.

Commit migrated from https://github.com/dotnet/corefx/commit/53dc908890102d3a888ba603a06266b85d3f4a9b

src/libraries/System.Net.Http/tests/StressTests/HttpStress/Program.cs

index d1b0a2d..6d396d5 100644 (file)
@@ -537,6 +537,7 @@ public class Program
             // Spin up a thread dedicated to outputting stats for each defined interval
             new Thread(() =>
             {
+                long lastTotal = 0;
                 while (true)
                 {
                     Thread.Sleep(DisplayIntervalMilliseconds);
@@ -545,7 +546,14 @@ public class Program
                         Console.ForegroundColor = ConsoleColor.Cyan;
                         Console.Write("[" + DateTime.Now + "]");
                         Console.ResetColor();
+
+                        if (lastTotal == total)
+                        {
+                            Console.ForegroundColor = ConsoleColor.Red;
+                        }
+                        lastTotal = total;
                         Console.WriteLine(" Total: " + total.ToString("N0"));
+                        Console.ResetColor();
 
                         if (reuseAddressFailure > 0)
                         {