PdceClientRegister Function

Action

This function registers any client to the data collection engine. The first parameter returns a handle that is needed for further PDCE functions. The second parameter specifies the interval in milliseconds, in which the PDCE collects data for the client. This interval can be changed any time by the PdceClientInterval() function. Usually, it makes sense to register your clients in the TInit transaction after the PdceStartup(). The last three parameters have to be NULL, as they are used for callback functionality. Note that callbacks are not supported in Silk Performer scripts.

注: If you collect data in a smaller interval than 1000 milliseconds, your result measures may have wrong values.

Include file

Pdce.bdh

Syntax

PdceClientRegister( out hPdce     : number,
                    in  uInterval : number ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hPdce Specifies the client's handle.
uInterval Specifies an unsigned integer for the query interval.

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;    
    fPdceInitInterval : float;
  begin    
    // Insert here the initial statements    
    PdceStartup();    PdceClientRegister(pClient, uiPdceInternalQueryInterval);    
    sMeasureKey     := PERFMON_SAMPLE_MEASURE;    
    sMeasureName[1] := "PerfmonMeasure1";    
    PdceAddMeasure(pClient, sMeasureName[1], sMeasureKey, pMeasure[1]);    
    wait(fPdceInitInterval);    
    PdceMeasureQueryInfo(pMeasure[1], sDescription, STRING_SIZE);    
    write(sMeasureName[1]);    
    write(": ");    
    writeln(sDescription);    
    writeln;  
  end TInit;