Access Raw Data with Performance Counters in Visual C++
Though Windows allows you direct access to performance data, using the native C API is unwieldy. James Curran explains a few C++ techniques to help make it more manageable.
by James Curran
October 21, 2002
indows lets you monitor a large number of internal statistics. Most people only see them in the Performance Monitor utility. This is fine if all you need is to look at graphs, but to fully study and analyze the information, you'll need to get at the raw data. Windows gives you access to the raw data, but only through a cumbersome C API. However, with the proper application of a few C++ techniques, you can make the whole process much simpler.
Working with (and Wrapping) Queries
At the lowest level, the structures used are defined in the Platform SDK header <winperf.h>. Microsoft apparently realized that those were too tedious for most people to use, so they built a new interface on top of that, known as the Performance Data Helper (PDH) interface. Though the PDH was only a slight improvement, you can still build a useable interface with it.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!