PdceAddMeasure Function

Action

This function adds a new measure to a client. It is a wrapper for PdceMeasureSubscribe that hides unused parameters.

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

PdceAddMeasure( in    hClient      : number,
                inout sMeasureName : string,
                inout sMeasureKey  : string,
                inout hMeasure     : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hClient Specifies the client's handle, from the PdceRegisterClient or PdceClientRegister function.
sMeasureName Specifies the name for the measure.
sMeasureKey Specifies the string that defines the measure.
hMeasure Specifies the measure's handle (needed for other measure functions).

Example

benchmark Collect
use "pdce.bdh" 

const  
  MEASURE_NAME01 := "PE_% Processor Time(0)@LAB35";  
  MEASURE_KEY01  := "PERFMON:\\Processor(0)\\% Processor Time@LAB35"; 

var  
  nInterval  : number;  
  hClient01  : number;  
  hMeasure01 : number; 

dcluser  
  user    
    Collect  
  transactions    
    NoTRT_TStartup  : begin;    
    NoTRT_TCollect  : 5;    
    NoTRT_TEnd      : end; 

dcltrans  
  transaction NoTRT_TStartup  
  begin    
    PdceStartUp();
    PdceRegisterClient(hClient01, nInterval);
    PdceAddMeasure(hClient01, MEASURE_NAME01, MEASURE_KEY01, hMeasure01); 

    Wait(float(2*nInterval));  
  end NoTRT_TStartup; 

  transaction NoTRT_TCollect  
  begin    
    PdceGetMeasureValue(hMeasure01, MEASURE_NAME01);
     
    if (GetWorkloadModel() <> WORKLOAD_MONITORING) then      
      Wait(float(nInterval));
    end;  
  end NoTRT_TCollect; 

  transaction NoTRT_TEnd  
  begin    
    PdceMeasureUnSubscribe(hMeasure01);    
    PdceClientUnRegister(hClient01);   
    PdceCleanUp();  
  end NoTRT_TEnd;