Performance Counter.

  • Thread starter Thread starter Itay
  • Start date Start date
I

Itay

Hi All ,

Is there a way to add a new counter (PerformanceCounter) to an existing
category ?

I deeply looked into the Performace Couneter API under the
System.Diagnostics but i couldn't found anything doing it.

If anyone knows a way doing it (even in c++) please reply.

Thanks , Itay.
 
I was unable to do that without re-creating the whole category with its
existing performance counters and the new one, but I am not sure if there is
a direct way.

--

Carlos J. Quintero

MZ-Tools 4.0: Productivity add-ins for Visual Studio .NET
You can code, design and document much faster.
http://www.mztools.com
 
Itay,

checkout http://www.codeproject.com/dotnet/perfcounter.asp . You can add new
counters via the server explorer window. The article is in c#, but you
should easily do so in mc++.

If you don't use any of the predefined categories you should keep your
CounterCreationDataCollection anywhere and everytime a counter gets added
you'ld have to recreate the whole category. I haven't found another way too,
but I must admit I haven't checked the win32 implementation in details yet.

Regards,
Michael
 
Back
Top