Last active
August 29, 2015 14:08
-
-
Save sajayantony/85189bdf7ec0ed3ce97c to your computer and use it in GitHub Desktop.
Performance Counter Names
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var query = PerformanceCounterCategory | |
.GetCategories() | |
.SelectMany (category => | |
category.GetInstanceNames() | |
.DefaultIfEmpty(string.Empty) | |
.SelectMany (name => category.GetCounters(name))) | |
.Select (counter => { | |
var name = String.IsNullOrEmpty(counter.InstanceName)? string.Empty: "\\(" + counter.InstanceName + ")"; | |
return "\\" + counter.CategoryName + name + "\\" + counter.CounterName; | |
}); | |
var counters = query.Take(500).Dump(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment