PerfMonAdd Function

Action

Opens a Windows NT performance counter and returns a handle to the counter.

Include file

Kernel.bdh

Syntax

PerfMonAdd( out hPerf     : number,
            in  sComputer : string,
            in  sObject   : string,
            in  sCounter  : string,
            in  sInstance : string optional ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hPerf Variable receiving the handle to the specified Performance Monitor counter.
sComputer Name of the computer you want to monitor.
sObject Name of the performance object. An object defines the set of counters that monitor the behavior of a specific hardware or software component, such as a processor or a thread.
sCounter Counter type. The counter type determines how the counter data is calculated and averaged.
sInstance Specifies an instance of the Performance Monitor counter to monitor (optional).

Example

var
  hCounter: array [3] of number;

dcltrans
  transaction TInit
  begin
    PerfMonAdd(hCounter[1], "localhost", "System",
               "% Total Processor Time");
    PerfMonAdd(hCounter[2], "localhost", "Processor",
               "% Processor Time", "0");
    PerfMonAdd(hCounter[3], "localhost", "Memory",
               "Committed Bytes");
  end TInit;