This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!
Configuring PerformanceCounter Components
There are a variety of properties you must set on the PerformanceCounter components you create. These determine the counter with which the component interacts. The properties you must set include:
- CategoryName, which determines the performance object with which the component will interact. All performance counters in Windows are grouped by categories, such as Memory, Processes, and Processor.
- CounterName, which identifies the counter within the specified category with which the component will interact.
- InstanceName, which identifies the instance of the category with which the component will interact. Note that many categories do not contain instances, so this property might be left blank, indicating a single instance counter.
Note If the Category has been set to a category that was not defined by the user, you must choose from existing counters and instances. You can only create new counters and instances in custom categories. For example, you cannot create a new counter in the Memory category, but if you create a new category called Orders, you can define as many counters and instances as you need within that category.
- MachineName, which identifies the server on which the performance counter with which you want your component to interact resides. You can set this property to "." to indicate the local machine.
Note You can write counters only on the local machine. If you intend to read counter values, you can choose any computer to which you have access.
To configure an instance of the PerformanceCounter component
- Create an instance of the PerformanceCounter component. For details, see Creating PerformanceCounter Components .
- Indicate the counter with which your component should interact by setting the following properties.
Property |
Setting |
MachineName |
Any server to which you have access. |
CategoryName |
Any category that exists on the server. |
CounterName |
Any counter within the selected category. |
- If the counter with which you're interacting has several instances, choose the appropriate one in the InstanceName field.
See Also
Creating PerformanceCounter Components