PdceMeasureQueryValue Function

Action

This function provides the actual values for a given measure. If it gets called more than once for one interval of the registered client, it will return always the same values.

Include file

Pdce.bdh

Syntax

PdceMeasureQueryValue( in  hMeasure          : number,
                       out fMeasureLastValue : float,
                       out fMeasureSum       : float,
                       out fMeasureMin       : float,
                       out fMeasureMax       : float,
                       out fMeasureAvg       : float,
                       out fMeasureStDev     : float,
                       out nMeasureTimeStamp : number,
                       out nMeasureStatus    : number ): boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
hMeasure Specifies the measure's handle, from the PdceMeasureSubscribe or PdceAddMeasure function.
fMeasureLastValue Specifies a floating point to receive the last queried value.
fMeasureSum Specifies a floating point to receive the sum of all queried values.
fMeasureMin Specifies a floating point to receive the minimum of all queried values.
fMeasureMax Specifies a floating point to receive the maximum of all queried values.
fMeasureAvg Specifies a floating point to receive the average of all queried values.
fMeasureStDev Specifies a floating point to receive the standard deviation of all queried values.
uMeasureTimeStamp Specifies an unsigned integer to receive the timestamp of the last queried value.
uMeasureStatus Specifies an unsigned integer to receive the status of the last queried value.

Example

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

 dcltrans
  transaction TPdceMonitor
  var
    sMeasureKey        : string;
    sMeasureName       : array[10] of string;
    sDescription       : string;
    fMeasureLastValue  : float;
    fMeasureSum        : float;
    fMeasureMin        : float;
    fMeasureMax        : float;
    fMeasureAvg        : float;
    fMeasureStDev      : float;
    uiMeasureTimeStamp : number;
    uiMeasureStatus    : number;
    uiErrorCode        : number;
    sErrorText         : string;
  begin
    // get actual status of measure
    PdceMeasureQueryStatus(pMeasure[1], uiErrorCode, sErrorText, STRING_SIZE);
    // get actual values of measure
    PdceMeasureQueryValue(pMeasure[1], fMeasureLastValue, fMeasureSum, fMeasureMin, fMeasureMax,
    fMeasureAvg, fMeasureStDev, uiMeasureTimeStamp, uiMeasureStatus);
    // write to output file
    write(sMeasureName[1]);
    write(": Timestamp:");
    write(uiMeasureTimeStamp,10);
    write(" Value: ");
    write(fMeasureLastValue,8,2);
    write(" Sum: ");
    write(fMeasureSum,10,2);    write(" Min: ");    write(fMeasureMin,8,2);    write(" Max: ");    write(fMeasureMax,8,2);
    write(" Avg: ");    write(fMeasureAvg,8,2);    write(" StDev: ");    write(fMeasureStDev,8,2);    write(" Status: ");    writeln(sErrorText);
  end TPdceMonitor;