PdceMeasureSubscribe Function

Action

This function adds a new measure to a client. At every interval, the data for the added measure is collected from the client. The interval can be changed any time by the PdceClientInterval() function. The query functions of the PDCE enable you to retrieve the values and statuses of the last collection cycle from the client. After subscribing a measure, you should wait for one interval length before querying data from the measure. This is done to give the PDCE time for initializing the new measure with the first value. The subscription of your measures can also be done in the TInit transaction after you have registered your client.

Include file

Pdce.bdh

Syntax

PdceMeasureSubscribe( in  hPdce        : number,
                      in  NULL         : number,
                      in  sMeasurename : string,
                      in  sKeyId       : string,
                      in  nOption      : number,
                      out hMeasure     : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hPdce Specifies the client's handle, from the PdceClientRegister or PdceRegisterClient function.
NULL Unused measure context handle.
sMeasurename Specifies the name for the measure.
sKeyId Specifies the string, that defines the measure.
nOption Specifies an unsigned integer (not used by now = 0).
hMeasure Specifies the measure's handle (needed for other measure functions).

Example

const
  STRING_SIZE            := 1024;
  PERFMON_SAMPLE_MEASURE := "PERFMON:\\Processor(_Total)\\% Processor Time@localhost";

 dcltrans
  transaction TInit
  var
    sMeasureKey        : string;
    sMeasureName       : array[10] of string;
    sDescription       : string;

  begin
    // Insert here the initial statements
    PdceStartup();
    PdceClientRegister(pClient, uiPdceInternalQueryInterval);
    sMeasureKey := PERFMON_SAMPLE_MEASURE;
    sMeasureName[1] := "PerfmonMeasure1";
    PdceMeasureSubscribe(pClient, NULL, sMeasureName[1], sMeasureKey, 0, pMeasure[1]);

    PdceMeasureQueryInfo(pMeasure[1], sDescription, STRING_SIZE);
    
    write(sMeasureName[1]);
    write(": ");
    writeln(sDescription);
    writeln;
  end TInit;