MeasureGetPercentile Function

Action

Retrieves the quantile value of a measure identified by sName and nClass for a given percentage (3rd parameter).
Note: The function returns the percentile value aggregated by the process that hosts the virtual user(s). This process is the perfRun.exe. Thus, the returned percentile value is based on all virtual users running in that process.

Include file

Kernel.bdh

Syntax

MeasureGetPercentile( in  sName  : string,
                      in  nClass : number,
                      in  fP     : float,
                      out fValue : float ) : boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sName Measure name that identifies the measure.
nClass

Specifies the type of measure to retrieve.

To retrieve the value of a custom time measure, pass the MEASURE_TIMER_RESPONSETIME parameter to the function.

To retrieve the value of a custom counter, pass the MEASURE_COUNTER_CUSTOMCOUNTER parameter to the function.

To retrieve the value of an average counter, pass the MEASURE_COUNTER_AVERAGE parameter to the function.

In any other case, pass any of the following parameters to the function, depending on the type of information you are interested in.

  • MEASURE_PAGE_PAGETIME (for protocol-level load testing)

  • MEASURE_PAGE_ACTIONTIME (for browser-driven load testing)

  • MEASURE_PAGE_PAGEBYTES

  • MEASURE_PAGE_EMBEDDEDBYTES

  • MEASURE_PAGE_DOCDOWNLOAD

  • MEASURE_PAGE_SERVERBUSY

  • MEASURE_IIOP_ROUNDTRIP

  • MEASURE_IIOP_SERVERBUSY

  • MEASURE_SQL_SQLPARSE

  • MEASURE_SQL_SQLEXEC

  • MEASURE_SQL_SQLEXECDIRECT

  • MEASURE_TRANS_TRANSOK

  • MEASURE_TRANS_TRANSERR

  • MEASURE_TRANS_TRANSCA

  • MEASURE_FORM_BYTESSENT

  • MEASURE_FORM_BYTESRECEIVED

  • MEASURE_FORM_HITSOK

  • MEASURE_FORM_HITSERR

  • MEASURE_FORM_ROUNDTRIP

  • MEASURE_FORM_SERVERBUSY

  • MEASURE_TUXEDO_BYTESSENT

  • MEASURE_TUXEDO_BYTESRECEIVED

  • MEASURE_TUXEDO_RESPONSETIME

fP The percentage must be in the range of 0.0 to 1.0.
fValue Retrieves the quantile value.

Example

benchmark MeasureBenchmarkName
use "kernel.bdh"

dclrand
  r2 : RndUniF(5.0..55.0);

dcluser
  user
    User1
  transactions
    TInit        : begin;
    TMain        : 1;

dcltrans
  transaction TInit
  begin
    // enable quantile data for a custom measure
    MeasureCalculatePercentiles("measure1", MEASURE_COUNTER_CUSTOMCOUNTER);
  end TInit;

  transaction TMain
  var
    i      : number;
    f, fV  : float;
  begin
    // get 500 random numbers in the range of 5.0 to 55.0
    for i := 1 to 500 do
      MeasureSetFloat("measure1", MEASURE_COUNTER_CUSTOMCOUNTER, r2);
    end;

    // show percentile estimation for 10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%
    f:= 0.1;
    while f < 1.01 do
      MeasureGetPercentile("measure1", MEASURE_COUNTER_CUSTOMCOUNTER, f, fv);
      Print(string(f) + " = " + string(fV));
      f := f + 0.1;
    end;
  end TMain;