MeasureGet Function

Action

Retrieves a specific Silk Performer measure value, for example, the maximum, the minimum or the average value of a specified measure performed during the simulation of the current virtual user, or the standard deviation of the collected measure values.

Using this function, you can do the following:

  • Retrieve the value of a custom time measurement performed using the MeasureStart and the MeasureStop function.

  • Retrieve the counter value of a custom counter accessed using the MeasureInc function.

  • Check how often specific transactions have been executed successfully, and how often given transactions have been canceled.

  • Retrieve response times and throughput information concerning SQL commands, Web forms, CORBA objects, and TUXEDO services.

Include file

Kernel.bdh

Syntax

MeasureGet( in  sName  : string,
            in  nClass : number,
            in  nKind  : number,
            out fTime  : float,
            in  bAll   : boolean optional):boolean;

Return value

  • true if successful

  • false otherwise

Parameter Description
sName

Name of the object concerned with the measurement. Must be one of the following:

  • Custom time measure. Pass to the function exactly the same name as to the MeasureStart and the MeasureStop function

  • Custom counter. Pass to the function exactly the same name as to the MeasureInc function

  • Transaction. Specify the transaction name as declared in the load testing script.

  • SQL command. Make sure to specify the SQL command identifier (defined in the dclsql section of the test script) in capital letters.

  • Web form. Make sure the specify the Web form identifier (defined in the dclform section of the test script) in capital letters.

  • CORBA object

  • TUXEDO service

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

nKind

Specifies the type of measure value to retrieve. The following options are possible:

  • MEASURE_KIND_SUM. Retrieves the sum of all measure values, for example, the total time for executing all transactions

  • MEASURE_KIND_COUNT. Retrieves the number how often an action was performed, for example, how often a counter was incremented, or how often a transaction was executed

  • MEASURE_KIND_AVERAGE. Returns the average of all measure values, for example, the average time required for a CORBA operation call.

  • MEASURE_KIND_MIN. Returns the minimum of all measure values

  • MEASURE_KIND_MAX. Returns the maximum of all measure values

  • MEASURE_KIND_LAST. Returns the last value set for the measure

  • MEASURE_KIND_SQSUM. Calculates for each measure value the square value, and sums up all square values.

  • MEASURE_KIND_STDEVIATION. Returns the standard deviation of all measured values

fTime Variable receiving the measure value
bAll

Specifies the time interval used for measurement value calculation (optional).

  • If this parameter is set to true, the measure value is calculated based on all measurements performed during the simulation.

  • Otherwise, if this parameter is set to false, the measure value is calculated based only on the measurements performed during the measurement interval (default).

Example

dcluser
  user
    TestUser
  transactions
    TInit : begin;
    TMain : 10;
    TShutdown : end;

dcltrans
  transaction TInit
  begin
    // start custom time measurement
    MeasureStart("TimeMeasure");
  end TInit; 

  transaction TMain
  begin
    // increment custom counter
    MeasureInc("TranCounter");
    wait 0.3;
  end TMain; 

  transaction TShutdown
  var
    fValue: float;
  begin
    // stop custom time measurement
    MeasureStop("TimeMeasure");
    MeasureGet("TimeMeasure", MEASURE_TIMER_RESPONSETIME, MEASURE_KIND_SUM, fValue);
    write("Transaction execution took "); write(fValue);
    write(" seconds"); writeln;
    MeasureGet("TInit", MEASURE_TRANS_TRANSOK, MEASURE_KIND_COUNT, fValue);
    write("TInit transaction was executed ");
    write(fValue);
    write(" times"); writeln;
    MeasureGet("TranCounter", MEASURE_COUNTER_CUSTOMCOUNTER, MEASURE_KIND_COUNT, fValue);
    write("TMain transaction was executed ");
    write(fValue);
    write(" times"); writeln;
  end TShutdown;

Sample scripts

Measure01.bdf, WebMeasure01.bdf