JavaScript Functions > Alphabetical Listing of Utility Functions (lr) > lr.userDataPoint

lr.userDataPoint

Records a user-defined data sample.

ExampleInformational Functions

Syntax

lr.userDataPoint( sampleName, value );

Arguments

ArgumentComments
sampleNameThe data point name.
value The numeric value to record.

The lr.userDataPoint function allows you to record your own data for analysis. Each time you want to record a point, use this function to record the sample name and the value. The time of the sample is recorded automatically. After the execution, you can use the User Defined Data Points graph to analyze the results.

The following prefixes in sampleName are reserved:

A data point with any of these prefixes, for example "HTTP_BT", will not appear on the graph. However, the prefixes are case-sensitive, therefore "http_BT" is a valid sampleName.

Return Values

Not applicable

Parameterization

All string arguments can be parameterized using standard parameterization.

Example

function Action(){
   var cpuVal = 80;
   for (i=0;i<100;i++) {
    //............
    lr.userDataPoint("cpu", cpuVal);
    lr.thinkTime(1);
   }

   return 0;
}