Due to significant performance and reliability limitations, the method for providing performance counter data that this topic describes may be altered or unavailable in the future. Instead, Microsoft recommends that you use the method described in Providing Counter Data Using Version 2.0 for creating new performance counters, and that you migrate existing performance counters to use that method as well.
Performance counters specific to your application can help you tune performance while you develop and debug the application. After your application is complete and installed on target systems, the counters can help system administrators adjust configurable settings for your application.
Adding a performance object and its counters
Design the object types and counters for the application. For details, see Object and Counter Design.
Set up the necessary performance monitoring entries in the registry. This includes the following steps.
Create a registry key in the Services key for the application. If you do not have such a node, create it under the following registry key: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services. For details, see Creating the Application's Performance Key.
Use the lodctr utility with the .ini and .h files to install the information in the registry. This utility succeeds only if a performance key exists in the Services key for the application. For details, see Adding Counter Names and Descriptions to the Registry.
Create a performance DLL containing a set of exported functions that provide the queried counter data to the consumer. For details, see Creating a Performance Extension DLL.
Modify the application's setup file to automate adding information to the registry (as described in step 4) and copy your performance DLL to your application's directory at setup.
Do you want to learn about application performance and monitoring? Learn what is required to write performant code, understand how you can monitor application performance, and get required insights.