Graphisoft®

GSRootVersion: 1.0

PMAddCounter

Windows NT only!

The PMAddCounter function adds the specified counter to the counter set of the last added object.

long PMAddCounter(
  long          type,         // type of counter
  const char    *name,             // counter name
  const char    *help              // additional information
);

 

Parameters

type
Specifies the type of the counter to add. This parameter must be one of the following values:
Value Meaning
CT_RAW_COUNTER The counter value is valid without additional calculation; that is, it should be displayed as it is.
CT_RATE_COUNTER The counter value should be divided by the elapsed time to get the specified performance measure.
CT_DELTA_COUNTER The difference between the previous counter value and the current counter value is computed before proceeding.
name
Specifies the name of the counter.
help
Gives additional information displayed in explain section of the Performance Monitor.

Return Values

If the function succeeds, the return value is a zero-based index of the counter in the counter list containing performance counters that are previously added by PMAddCounter. You can refer to the added counter with the returned index.

If the function fails, return value is -1.

Remarks

Use this function only in the case when no counter is in use.

Calling PMAddCounter must be always preceded by at least one call of PMAddObject.

If you finish adding counters to the actual object, you can add new object with PMAddObject. If you want to use your counters (make them recognized by Performance Monitor), call PMUseCounters.

Requirements

    Header: Declared in GSRoot.h
    Import Library: Link with GSRootImp.lib

See Also

Performance Monitor Manager Functions, PMAddObject, PMUseCounters