tags:

views:

19

answers:

1

When I create performance counters in Windows Vista, I see that there is a "parent" column in the performance monitor listview that lists the counters.

What is parent? I haven't seen a way to set it using managed code. Is it only available if I use the Winapi?

+2  A: 

The syntax of a counter path is:

\\Computer\PerfObject(ParentInstance/ObjectInstance#InstanceIndex)\Counter

The Computer element specifies the name or IP address of the computer from which you want to query performance data. The computer name is optional if the counter is located on the local computer.

The PerfObject element specifies the performance object to query. A performance object can be a physical component, such as processors, disks, and memory, or a system object, such as processes and threads. Each system object is related to a functional element within the computer and has a set of standard counters assigned to it. Each computer may have a different set of performance objects and counters installed on it because applications can install their own performance objects and counters. For a list of the performance objects and counters installed on your computer, see the Add Counters dialog box in the Performance tool on your computer. These objects are also listed in the PDH browse dialog box (see Browsing Counters). For a list of system performance objects and counters, see Counters by Object.

The ParentInstance, ObjectInstance, and InstanceIndex are included in the path if multiple instances of the object can exist. For example, processes and threads are multiple instance objects because more than one process or thread can run at the same time. If an object can have more than one instance, the counter path must specify an object instance.

From here.

Mitch Wheat