MeasureCalculatePercentiles Function

Action

Enables the collection of quantile data for the measure identified by sName and nClass. Collected quantile data is shown in the overview report and can also be queried using the MeasureGetPercentile function.

This function can be used before a measure is created and/or used.

Include file

Kernel.bdh

Syntax

MeasureCalculatePercentiles( in sName        : string allownull,
                             in nClass       : number,
                             in bDisable     : boolean optional,
                             in fPQuantile   : float optional,
                             in nMarkerCount : number optional ):
boolean;

Return value

Parameter Description
sName Measure name that identifies the measure. When this parameter is set to NULL or "", quantile data collection is enabled for all measures of the provided measure type.
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

  • 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

bDisable Specifies whether percentiles calculation should be disabled or enabled (optional, default is FALSE).
fPQuantile Specifies a value between 0 and 1 indicating the position round which the markers are grouped (optional, default is 0.5).
nMarkerCount Specifies the number of markers, which the percentile graph is based on. nMarkerCount must be an odd value <= 67 (optional, default is 21).

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 to500 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.0 do
      MeasureGetPercentile("measure1", MEASURE_COUNTER_CUSTOMCOUNTER,f, fv);
      Print(string(f) + " = " + string(fV));
      f := f + 0.1;
    end;
  end TMain;
Related reference
MeasureGetPercentile Function
MeasureGet Function
MeasureSetFloat Function