Reputation: 2625
I have created a PerformanceCounterCategory like below
var category = PerformanceCounterCategory.Create("MyCat", "Cat Help",
PerformanceCounterCategoryType.SingleInstance, "MyCounter", "Counter Help);
How can I add a new counter to the category to monitor another item?
I cannot find the api for it.
Upvotes: 26
Views: 5379
Reputation: 7692
I did a research on this a while back and it doesn't seem to be possible to add counters to an existing category, what you would have to do it to recreate the same category with addition of the new counter.
Upvotes: 33
Reputation: 1771
PerformanceCounter lCounter = new PerformanceCounter(Category, CounterName,
false);
lCounter.MachineName = ".";
Upvotes: -4