PdceGetMeasureValue Function

Action

This function provides the last queried values for a given measure. The last queried value is stored in a custom counter with the name specified by the second parameter.

Include file

Pdce.bdh

Syntax

PdceGetMeasureValue( in  hMeasure     : number,
                     in  sMeasureName : string,
                     in  nScaleFactor : number optional,                   
                     out fValue       : float optional ): boolean

Return value

  • true if successful

  • false otherwise

Parameter Description
hMeasure Specifies the measure's handle, from the PdceMeasureSubscribe or PdceAddMeasure function.
sMeasureName Specifies the name for the custom counter where the last queried value is stored in.
nScaleFactor Optional scale factor by which the retrieved value is divided.
fValue Optional floating point value which is set to the current value.

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;