Platform SDK: Performance Monitoring

Using the PDH Interface

The basic process of using the PDH interface to collect performance data consists of the following steps.

  1. Create a query.
  2. Add counters to the query.
  3. Collect the performance data.
  4. Process the performance data.
  5. Close the query.

You can use this process to collect performance data from either real-time sources or log files. The collected data can be written to log files or displayed. Refer to Working with Log Files for more information on how to write performance data to log files.

You can obtain Information about specific counters and the performance data values they provide through PDH interface functions. Working with Counters, Performance Objects, and Machines describes how to obtain and set this information.

You can also use the PDH interface to obtain information about specific queries. Refer to Working with Queries for more on this topic.

The user can be prompted for both the data source and the name and location of the counters added to the query in Step 2 of the preceding list. Refer to Browsing Counters for information on how to do this.

You can also access counters on remote machines. Refer to Accessing Counters on Remote Machines for information on how to do this.

The following are useful things you can do with the PDH library that are adjuncts to the basic data collection procedure.