[This is preliminary documentation and subject to change.]
The PerfMon Provider returns performance-related information to management applications. Because PerfMon is a Microsoft® Windows NT®. tool, only management applications running on Windows NT platforms can use this provider.
The PerfMon Provider can be used as an instance provider to supply performance information relating to instances of WBEM classes; it can also function as a property provider to modify the data for a specific instance.
Because the PerfMon Provider is not automatically registered with CIMOM when WBEM installs, management applications wanting to use it must complete the registration process. To register the PerfMon Provider as either an instance provider or as a property provider, applications create a new MOF file that includes an instance of the __Win32Provider system class as the following code fragment demonstrates:
instance of __Win32Provider as $P
{
Name = "PerfProv" ;
ClsId = "{f00b4404-f8f1-11ce-a5b6-00aa00680c3f}" ;
};
An instance of a class derived from __ObjectProviderRegistration must also be created. If the PerfMon Provider is being registered as an instance provider, the application must create an __InstanceProviderRegistration instance. If the PerfMon Provider is being registered as a property provider, the application must create a __PropertyProviderRegistration instance. Examples of these two instances follow:
instance of __InstanceProviderRegistration
{
Provider = $P;
SupportsPut = FALSE;
SupportsGet = TRUE;
SupportsDelete = FALSE;
SupportsEnumeration = TRUE;
};
instance of __PropertyProviderRegistration
{
Provider = $P;
SupportsPut = TRUE;
SupportsGet = TRUE;
The MOF file containing these two instances can either be compiled as a standalone file or included at the top of an application-specific MOF file. The application-specific MOF file typically contains classes and instances that are meant to store the performance data. The following class provides an example. The Provider qualifier specifies the PerfMon Provider as the dynamic provider responsible for managing the data for the class. The ClassContext qualifier specifies information needed by the PerfMon Provider to access the data. The PropertyContext qualifiers identify the PerfMon values to be stored in each property.
[dynamic, provider("PerfProv"), ClassContext("local|Process")]
class NTProcesses
{
[key]
String Process;
[PropertyContext("ID Process")]
uint32 ID;
[PropertyContext("Elapsed Time")]
real32 Time;
[PropertyContext("Handle Count")]
uint32 Handles;
[PropertyContext("Working Set")]
uint32 WorkingSet;
[PropertyContext("Working Set Peak")]
uint32 WorkingSetPeak;
[PropertyContext("Virtual Bytes")]
uint32 VirtualBytes;
[PropertyContext("Virtual Bytes Peak")]
uint32 VirtualBytesPeak;
[PropertyContext("Thread Count")]
uint32 Threads;
[PropertyContext("Priority Base")]
uint32 Base;
};
Some of the counter types available from the PerfMon Provider cannot be returned as instances. To use these counters in an application, create a singleton class by attaching the Singleton standard qualifier to the class as is shown below. Note the lack of a key property.
[Singleton, Dynamic, Provider("PerfProv"),
ClassContext("local|Memory")]
class memory
{
[PropertyContext("Available Bytes")]
uint32 Avail;
[PropertyContext("Cache Bytes")]
uint32 Cache;
};