How to enumerate installed performance classes?  Download
The performance class is a collection of performance counters. For example, a class with name "System" may define several performance counters, such as "Processor Queue Length", "Context Switches/sec", "System Up Time", etc.

The Delphi function below retrieves the list of performance classes installed on the local or remote computer. This example utilizes TWmiPerformanceMonitor component. The source code below creates and destroys the components on the fly, so this function may be used in console- or UI-type applications.


// This procedure determines the list of performance counters
// installed on the target computer. On exit, it will populate
// ClassNames parameter with the names of the found classes.
// When used for local host, all the remaining parameters must be empty.
// For remote compupter, the parameters must be:
// TargetHost: name or IP address of the host, like '10.8.36.54' 
// UserName: name of the user, may include domain, like 'MOON\Administrator';
// Password: the user's password. 
procedure ListPerformanceClasses(ClassNames: TStrings;
    TargetHost, UserName, Password: string);
var
  vMonitor: TWmiPerformanceMonitor;
  i, count: integer;
begin
  vMonitor := TWmiPerformanceMonitor.Create(nil);
  try
    vMonitor.MachineName := TargetHost;
    vMonitor.Credentials.UserName := UserName;
    vMonitor.Credentials.Password := Password;

    // try to connect. It may fail if the destination computer does not have 
    // WMI (like windows 95, 98, NT without WMI core installed), or 
    // if the provided credentials are not valid 
    try
      vMonitor.Active := true;
    except
      Exit;
    end;

    count := vMonitor.PerfClasses.Count;
    for i := 0 to count - 1 do
      ClassNames.Add(vMonitor.PerfClasses[i].DisplayName + ': ' +
                     vMonitor.PerfClasses[i].WmiClassName);
  finally
    vMonitor.Free;
  end;

end;