public static int List(IConsole console, string runtimeVersion) { if (!s_SupportedRuntimeVersions.Contains(runtimeVersion)) { Console.WriteLine($"{runtimeVersion} is not a supported version string or a supported runtime version."); Console.WriteLine("Supported version strings: 3.0, 3.1, 5.0"); return(0); } var profiles = KnownData.GetAllProviders(runtimeVersion); var maxNameLength = profiles.Max(p => p.Name.Length); Console.WriteLine($"Showing well-known counters for .NET (Core) version {runtimeVersion} only. Specific processes may support additional counters."); foreach (var profile in profiles) { var counters = profile.GetAllCounters(); var maxCounterNameLength = counters.Max(c => c.Name.Length); Console.WriteLine($"{profile.Name.PadRight(maxNameLength)}"); foreach (var counter in profile.Counters.Values) { Console.WriteLine($" {counter.Name.PadRight(maxCounterNameLength)} \t\t {counter.Description}"); } Console.WriteLine(""); } return(1); }
public static int List(IConsole console) { var profiles = KnownData.GetAllProviders(); var maxNameLength = profiles.Max(p => p.Name.Length); Console.WriteLine("Showing well-known counters only. Specific processes may support additional counters.\n"); foreach (var profile in profiles) { var counters = profile.GetAllCounters(); var maxCounterNameLength = counters.Max(c => c.Name.Length); Console.WriteLine($"{profile.Name.PadRight(maxNameLength)}"); foreach (var counter in profile.Counters.Values) { Console.WriteLine($" {counter.Name.PadRight(maxCounterNameLength)} \t\t {counter.Description}"); } Console.WriteLine(""); } return(1); }