Adding Performance Counters: the Big Picture

Performance Monitor was designed so that developers could add performance counters for their own applications to the system. To add performance counters to the system, you must create an extended object. Your extended object is called when Performance Monitor collects data, as shown in Figure 13.1. The Configuration Registry is handled by ADVAPI32.DLL in the Performance Monitor process on the local computer, and by SCREG.EXE on remotely monitored computers.

Figure 13.1 How Performance Monitor collects data from an extended object

To add performance objects and counters for your application, follow the basic steps in the list below. Each of these steps is discussed in detail in following sections of this chapter.

  1. Design the object types and counters for the application.
  2. Set up the necessary performance monitoring entries in the Registry. This includes the following steps:
  1. To your application, add functions and data structures for collecting and storing performance data, and a mechanism for communicating the data to the performance DLL.
  2. Create a performance DLL containing a set of exported functions that provide the link between the application and a performance monitoring application (such as Windows NT Performance Monitor).
  3. Modify the application's OEMSETUP.INF file to automate the Registry setup described in step 2.