MeasureSet Function

Action

Sets the value of a counter/timer identified by sName and nClass. When this function is called for a specified counter/timer for the first time, the counter is automatically allocated and initialised.

Predefined measures are using following units:

  • for timers: milliseconds.

  • for capacities: bytes.

Include file

Kernel.bdh

Syntax

MeasureSet(in sName     :string,
           in nClass    : number,
           in nValue    : number): 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.

  • Custom counter.

  • 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 that the specified Web form identifier (defined in the dclform section of the test script) is in capital letters.

  • CORBA object

  • TUXEDO service

nClass

Specifies the type of measure to set.

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

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

To set 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

nValue

Value to set. Predefined measures are using following units:

  • for timers: milliseconds.

  • for capacities: bytes.

Example

dcltrans
  transaction TMain
  var
    fValue :  float;
  begin
    MeasureSet("measure2", MEASURE_COUNTER_CUSTOMCOUNTER, 22);
    ...
    MeasureSet("measure2", MEASURE_COUNTER_CUSTOMCOUNTER, 22);
    ...
    MeasureGet("measure2", MEASURE_COUNTER_CUSTOMCOUNTER,
               MEASURE_KIND_SUM, fValue);
    Print("Val: " + string(fValue)); // expected value: 44
  end TMain;