lr.userDataPointEx

Records a user-defined data sample and enables logging option.

ExampleInformational Functions

Syntax

lr.userDataPointEx( sample_name, value, log_flag );

Arguments

ArgumentComments
sample_name A string indicating the name of the sample type.
value The numeric value to record.
log_flag Determines whether the data point should be logged or not. Possible values: lr. DP_FLAGS_NO_LOG (1); lr.DP_FLAGS_STANDARD_LOG (2); lr. DP_FLAGS_EXTENDED_LOG (3)

The lr.userDataPointEx function is the same as lr.userDataPoint except that lr.userDataPointEx has an additional parameter, log_flag.

Logging means writing data to a file. lr.userDataPointEx enables you to write a data point to the Vuser log file. When run in VuGen, the output is output.txt

You may want to write the data point conditionally according to how important the data to be logged is. It can either be part of a Standard level when only the most important information is logged or an Extended level, when fuller control over logging is required.

log_flag denotes the log level and corresponds to the settings found in VuGen's Log runtime setting. This setting specifies how the script handles logging to a file during execution. If DP_FLAGS_EXTENDED_LOG is passed to lr.userDataPointInstanceEx then the data point is logged only when the Extended runtime Log setting is currently activate. If log_flag is DP_FLAGS_STANDARD_LOG then it will be logged only if the Standard setting is active. DP_FLAGS_NO_LOG indicates that this data point is never written to a log file.

Return Values

Not applicable

Parameterization

All string arguments can be parameterized using standard parameterization.

Example

function Action(){
   for (i=0;i<100;i++) {
       cpu_val=cpu_check();
       lr.userDataPointEx("cpu", cpu_val, lr.DP_FLAGS_STANDARD_LOG);
       lr.thinkTime(10);
   }

   return 0;
}