Fix dotnet-counters console alignment (#2485)
authorNoah Falk <noahfalk@users.noreply.github.com>
Sat, 7 Aug 2021 00:50:18 +0000 (17:50 -0700)
committerGitHub <noreply@github.com>
Sat, 7 Aug 2021 00:50:18 +0000 (17:50 -0700)
Text was oddly shifting one character to the right during
updates. Fixed the off-by-one error in the update text
positioning.

src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs

index c1c36f15436a12ae86c5f207cb02438a6e1b2c57..de578d50351a0a3b6a77e593270fbbed024dd265 100644 (file)
@@ -114,7 +114,7 @@ namespace Microsoft.Diagnostics.Tools.Counters.Exporters
                     counter.Row = row++;
                     if (counter.RenderValueInline)
                     {
-                        Console.WriteLine($"{name}{FormatValue(counter.LastValue)}");
+                        Console.WriteLine($"{name} {FormatValue(counter.LastValue)}");
                     }
                     else
                     {
@@ -122,7 +122,7 @@ namespace Microsoft.Diagnostics.Tools.Counters.Exporters
                         foreach (ObservedTagSet tagSet in counter.TagSets.Values.OrderBy(t => t.Tags))
                         {
                             string tagName = MakeFixedWidth($"{new string(' ', 2 * Indent)}{tagSet.Tags}", Indent + maxNameLength);
-                            Console.WriteLine($"{tagName}{FormatValue(tagSet.LastValue)}");
+                            Console.WriteLine($"{tagName} {FormatValue(tagSet.LastValue)}");
                             tagSet.Row = row++;
                         }
                     }