Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 0 additions & 8 deletions src/Tools/dotnet-counters/CounterProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,6 @@ public CounterProvider(string name, string description, string keywords, string
}
}

public string TryGetDisplayName(string counterName)
{
if (Counters.ContainsKey(counterName))
return Counters[counterName].DisplayName;
return null;
}

public string ToProviderString(int interval)
{
return $"{Name}:{Keywords}:{Level}:EventCounterIntervalSec={interval}";
Expand All @@ -53,7 +46,6 @@ public static string SerializeUnknownProviderName(string unknownCounterProviderN
public class CounterProfile
{
public string Name { get; set; }
public string DisplayName { get; set; }
public string Description { get; set; }
}
}
2 changes: 1 addition & 1 deletion src/Tools/dotnet-counters/Exporters/ConsoleWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void CounterPayloadReceived(string providerName, ICounterPayload payload,

if (!provider.Counters.TryGetValue(name, out ObservedCounter counter))
{
string displayName = provider.KnownProvider?.TryGetDisplayName(name) ?? (string.IsNullOrWhiteSpace(payload.GetDisplay()) ? name : payload.GetDisplay());
string displayName = payload.GetDisplay();
provider.Counters[name] = counter = new ObservedCounter(displayName);
maxNameLength = Math.Max(maxNameLength, displayName.Length);
redraw = true;
Expand Down
46 changes: 23 additions & 23 deletions src/Tools/dotnet-counters/KnownData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,36 +23,36 @@ private static IEnumerable<CounterProvider> CreateKnownProviders()
"0xffffffff", // Keywords
"5", // Level
new[] { // Counters
new CounterProfile{ Name="cpu-usage", Description="Amount of time the process has utilized the CPU (ms)", DisplayName="CPU Usage (%)" },
new CounterProfile{ Name="working-set", Description="Amount of working set used by the process (MB)", DisplayName="Working Set (MB)" },
new CounterProfile{ Name="gc-heap-size", Description="Total heap size reported by the GC (MB)", DisplayName="GC Heap Size (MB)" },
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" },
new CounterProfile{ Name="active-timer-count", Description="Active Timers Count", DisplayName="Number of Active Timers" },
new CounterProfile{ Name="cpu-usage", Description="Amount of time the process has utilized the CPU (ms)" },
new CounterProfile{ Name="working-set", Description="Amount of working set used by the process (MB)" },
new CounterProfile{ Name="gc-heap-size", Description="Total heap size reported by the GC (MB)" },
new CounterProfile{ Name="gen-0-gc-count", Description="Number of Gen 0 GCs / min" },
new CounterProfile{ Name="gen-1-gc-count", Description="Number of Gen 1 GCs / min" },
new CounterProfile{ Name="gen-2-gc-count", Description="Number of Gen 2 GCs / min" },
new CounterProfile{ Name="time-in-gc", Description="% time in GC since the last GC" },
new CounterProfile{ Name="gen-0-size", Description="Gen 0 Heap Size" },
new CounterProfile{ Name="gen-1-size", Description="Gen 1 Heap Size" },
new CounterProfile{ Name="gen-2-size", Description="Gen 2 Heap Size" },
new CounterProfile{ Name="loh-size", Description="LOH Heap Size" },
new CounterProfile{ Name="alloc-rate", Description="Allocation Rate" },
new CounterProfile{ Name="assembly-count", Description="Number of Assemblies Loaded" },
new CounterProfile{ Name="exception-count", Description="Number of Exceptions / sec" },
new CounterProfile{ Name="threadpool-thread-count", Description="Number of ThreadPool Threads" },
new CounterProfile{ Name="monitor-lock-contention-count", Description="Monitor Lock Contention Count" },
new CounterProfile{ Name="threadpool-queue-length", Description="ThreadPool Work Items Queue Length" },
new CounterProfile{ Name="threadpool-completed-items-count", Description="ThreadPool Completed Work Items Count" },
new CounterProfile{ Name="active-timer-count", Description="Active Timers Count" },
});
yield return new CounterProvider(
"Microsoft.AspNetCore.Hosting", // Name
"A set of performance counters provided by ASP.NET Core.", // Description
"0x0", // Keywords
"4", // Level
new[] { // Counters
new CounterProfile{ Name="requests-per-second", Description="Request rate", DisplayName="Request / sec" },
new CounterProfile{ Name="total-requests", Description="Total number of requests", DisplayName="Total Requests" },
new CounterProfile{ Name="current-requests", Description="Current number of requests", DisplayName="Current Requests" },
new CounterProfile{ Name="failed-requests", Description="Failed number of requests", DisplayName="Failed Requests" },
new CounterProfile{ Name="requests-per-second", Description="Request rate" },
new CounterProfile{ Name="total-requests", Description="Total number of requests" },
new CounterProfile{ Name="current-requests", Description="Current number of requests" },
new CounterProfile{ Name="failed-requests", Description="Failed number of requests" },
});
}

Expand Down