Adding Performance Counters
Windows NT provides a mechanism for you to add performance objects and counters for your application and other software components. 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.
To add an extended object and its counters, use the following steps.
-
Design the object types and counters for the application. See Object and Counter Design.
-
Create an initialization (.INI) file containing the names and descriptions of the counter objects and counters. See Adding Counter Names and Descriptions to the Registry.
-
Create a header (.H) file containing the relative offsets at which the counter objects and counters will be installed in the registry. See Adding Counter Names and Descriptions to the Registry.
-
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. 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. See Adding Counter Names and Descriptions to the Registry.
-
Create a performance DLL containing a set of exported functions that provide the link between the application and a performance monitoring application. See Creating the Performance DLL.
-
Modify the application's setup file to automate adding information to the registry (as described in step 4) and move your performance DLL to the system directory at setup.
To view an extended object, its functions, and its counter, use the extensible counter list utility (EXCTRLST.EXE). For more information, see ExCtrLst.