Kernel.bdh
MeasureGetPercentile( in sName : string, in nClass : number, in fP : float, out fValue : float ) : boolean;
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.
|
fP | The percentage must be in the range of 0.0 to 1.0. |
fValue | Retrieves the quantile value. |
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;