Share this page

# lr.user_data_point

Records a user-defined data sample.

## C#

    int lr.user_data_point( string  sample_name, double value );

## VB.NET

    Function lr.user_data_point( ByVal sample_name As String, ByVal value  As Double ) as Integer

Informational Functions

## Arguments

Name | Comments
--- | ---
sample_name | The data point name.
value | The value to record.

The lr.user_data_point 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 sample_name are reserved:

- HTTP
- NON_HTTP
- RETRY
- mic_
- stream_
- mms_

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 sample_name.

## Return Values

This function always returns zero.

## Parameterization

All string input arguments can be passed using standard parameterization.

## Example

The following example saves the CPU value as a user-defined data sample.

Copy code

    double CPUCheck()
    {
      System.Random random=new System.Random();
      double cpu=random.NextDouble()*100;
      return cpu;
    }

    for(int i=0;i<100;i++)
    {
     double cpu_val=CPUCheck();
     lr.user_data_point("cpu %", cpu_val);
     lr.sleep(10);
    }

    return 0;
    }

Tips to improve your search results... VuGen Function Reference Version 26.1-26.3 Function Reference 26.1-26.3 All View Local Help Center View Online Help Center Version: