Where can I find documentation for publishing data to perfmon in C ++?

A few years ago I wrote some code to β€œpublish” data for perfmon. The use of these counters is pretty well documented, but it was hard for me to find (at the time) good documentation and sample code to publish data for perfmon.

Does anyone know where I can get this documentation? I also recall some cool wrappers, but I could be wrong.


EDIT:

I found this one and I will continue to search for "custom application performance counters".

+2
source share
2 answers

You bring back old memories!

Since 1998, Jeffrey Richter has written an article in the Microsoft Systems Journal that describes how to create your own perfmon counters very easily (after cutting and pasting his template code, just add shared memory variables to the dll and update them as necessary).

+2
source

Are you looking for managed or native wrappers? The link you posted is managed, but your question is native (C ++). In a managed world, everything is pretty simple and straightforward to publish counters using PerformanceCounter and its relatives http://msdn.microsoft.com/en-us/library/system.diagnostics.performancecounter.aspx . For moderate volumes, they can also be used to read counters, for large volumes, but you should use PDH.DLL, since the overhead of managed counters reading one counter at a time will be overwhelming in my experience. Personally, I developed XSLT transformations to generate all prfmon counters in my applications, which I wrote about here: http://rusanu.com/2009/04/11/using-xslt-to-generate-performance-counters-code/ , and I have more recent stuff to blog down the pipe. If you have a question about an unmanaged API, I don’t have a pointer, but personally I would go the way of using XSLT again to generate all my perfmon code, as it repeats a lot.

+1
source

All Articles