Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I add a performance counter to a category i have already created

Tags:

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.

like image 358
Kev Hunter Avatar asked Jun 05 '09 21:06

Kev Hunter


People also ask

How do I create a performance counter?

You'll need to run Visual Studio as an administrator to create the category and counter. PerformanceCounterCategory customCategory = new PerformanceCounterCategory(categoryName); CounterCreationData counterCreationData = new CounterCreationData(firstCounterName, firstCounterHelp, PerformanceCounterType.

How do performance counters work?

Windows Performance Counters provide a high-level abstraction layer that provides a consistent interface for collecting various kinds of system data such as CPU, memory, and disk usage. System administrators often use performance counters to monitor systems for performance or behavior problems.

What is performance counter in C#?

Performance counters enable us to publish, capture, and analyze the performance data of running code. A performance graph is a two-dimensional plot with one axis indicating time elapsed and the other reporting relevant relative or actual performance statistics.


1 Answers

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.

like image 87
kay.one Avatar answered Sep 28 '22 12:09

kay.one