From: Sung Yoon Whang Date: Wed, 5 Jun 2019 18:46:03 +0000 (-0700) Subject: Add new counters to list (#309) X-Git-Tag: submit/tizen/20190813.035844~6^2^2~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4619fa2c0281da658a73952d95b32d4907530739;p=platform%2Fcore%2Fdotnet%2Fdiagnostics.git Add new counters to list (#309) * Add new counters to list * Fix typo / add unit to AllocRate --- diff --git a/src/Tools/dotnet-counters/ConsoleWriter.cs b/src/Tools/dotnet-counters/ConsoleWriter.cs index 2ae447641..602cd073d 100644 --- a/src/Tools/dotnet-counters/ConsoleWriter.cs +++ b/src/Tools/dotnet-counters/ConsoleWriter.cs @@ -17,15 +17,17 @@ namespace Microsoft.Diagnostics.Tools.Counters private int maxCol; // Running maximum of col number private int STATUS_ROW; // Row # of where we print the status of dotnet-counters private bool paused = false; + private bool initialized = false; private Dictionary knownProvidersRowNum; private Dictionary unknownProvidersRowNum; private void UpdateStatus(string msg) { Console.SetCursorPosition(0, STATUS_ROW); - Console.Write(new String(' ', 20)); + Console.Write(new String(' ', 42)); // Length of the initial string we print on the console.. Console.SetCursorPosition(0, STATUS_ROW); Console.Write(msg); + Console.SetCursorPosition(maxRow, maxCol); } public ConsoleWriter() @@ -72,16 +74,17 @@ namespace Microsoft.Diagnostics.Tools.Counters public void Update(string providerName, ICounterPayload payload, bool pauseCmdSet) { - if (paused != pauseCmdSet) + + if (!initialized) { - ToggleStatus(pauseCmdSet); + initialized = true; + UpdateStatus(" Status: Running"); } if (pauseCmdSet) { return; } - string name = payload.GetName(); // We already know what this counter is! Just update the value string on the console. diff --git a/src/Tools/dotnet-counters/CounterMonitor.cs b/src/Tools/dotnet-counters/CounterMonitor.cs index ff626d9fe..dc29942c8 100644 --- a/src/Tools/dotnet-counters/CounterMonitor.cs +++ b/src/Tools/dotnet-counters/CounterMonitor.cs @@ -39,10 +39,7 @@ namespace Microsoft.Diagnostics.Tools.Counters { // If we are paused, ignore the event. // There's a potential race here between the two tasks but not a huge deal if we miss by one event. - if (pauseCmdSet) - { - writer.ToggleStatus(pauseCmdSet); - } + writer.ToggleStatus(pauseCmdSet); if (obj.EventName.Equals("EventCounters")) { diff --git a/src/Tools/dotnet-counters/KnownData.cs b/src/Tools/dotnet-counters/KnownData.cs index e8903b357..49c2bd344 100644 --- a/src/Tools/dotnet-counters/KnownData.cs +++ b/src/Tools/dotnet-counters/KnownData.cs @@ -30,7 +30,18 @@ namespace Microsoft.Diagnostics.Tools.Counters new CounterProfile{ Name="gen-0-gc-count", Description="Number of Gen 0 GCs / sec", DisplayName="Gen 0 GC / sec" }, new CounterProfile{ Name="gen-1-gc-count", Description="Number of Gen 1 GCs / sec", DisplayName="Gen 1 GC / sec" }, new CounterProfile{ Name="gen-2-gc-count", Description="Number of Gen 2 GCs / sec", DisplayName="Gen 2 GC / sec" }, + new CounterProfile{ Name="time-in-gc", Description="% time in GC since the last GC", DisplayName="% Time in GC (since last GC)" }, + new CounterProfile{ Name="gen-0-size", Description="Gen 0 Heap Size", DisplayName="Gen 0 Size (B)" }, + new CounterProfile{ Name="gen-1-size", Description="Gen 1 Heap Size", DisplayName="Gen 1 Size (B)" }, + new CounterProfile{ Name="gen-2-size", Description="Gen 2 Heap Size", DisplayName="Gen 2 Size (B)" }, + new CounterProfile{ Name="loh-size", Description="LOH Heap Size", DisplayName="LOH Size (B)" }, + new CounterProfile{ Name="alloc-rate", Description="Allocation Rate", DisplayName="Allocation Rate (Bytes / sec)" }, + new CounterProfile{ Name="assembly-count", Description="Number of Assemblies Loaded", DisplayName="# of Assemblies Loaded" }, new CounterProfile{ Name="exception-count", Description="Number of Exceptions / sec", DisplayName="Exceptions / sec" }, + new CounterProfile{ Name="threadpool-thread-count", Description="Number of ThreadPool Threads", DisplayName="ThreadPool Threads Count" }, + new CounterProfile{ Name="monitor-lock-contention-count", Description="Monitor Lock Contention Count", DisplayName="Monitor Lock Contention Count / sec" }, + new CounterProfile{ Name="threadpool-queue-length", Description="ThreadPool Work Items Queue Length", DisplayName="ThreadPool Queue Length" }, + new CounterProfile{ Name="threadpool-completed-items-count", Description="ThreadPool Completed Work Items Count", DisplayName="ThreadPool Completed Work Items / sec" }, }); // TODO: Add more providers (ex. ASP.NET ones) }