{
  "synLogic": "int $ret \u003d $api($1, $2);",
  "help": "The ns_user_data_point function allows you to record your own data for analysis. User have to pass \u0027Name\u0027 and \u0027value\u0027 to this API. The data point name should have text characters except the special characters (\" \u0027 % * , \u003c \u003e ` ~ \\ ^ | #). If any binary or any of these special characters are used, then these characters will be replaced by _(underscore). The maximum length is 1024 bytes. If it exceeds this length, then it will truncate. If the length is 0 then Name will replace by UdNameWithZeroLength. You can see the Data Point graph in Topology\u003eSubjects\u003eTestMetrics\u003ePerfTest\u003eSUbjects\u003eUserData metrics to analyze the results. \nThe graph is typically used in cases where the actual value of the measurement is required. like user wants to record response body size then he can use ns_url_get_body_size() to get the response of main url and pass the value to ns_user_data_point API as shown below.",
  "notes": "",
  "returns": "This function returns 0 if it succeeds, and -1 if it fails to write the sampled data.",
  "arguments": "\ndataPointName        Name of the data point. It can be text, C or java variables and cavisson parameters like dataset using file, search, declare etc.\nValue        The value to record. it should be in double data type",
  "parameterization": "You can use cavisson parameters for name argument in this function. Combination of text and parameter is not allowed",
  "component": [
    {
      "id": "$1",
      "type": "TEXT_VAR_PARAM",
      "label": "Data Point Name",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Data point name should have text characters except the special characters ( \" ' % * , < > ` ~ \\ ^ | #).The maximum length is 1024.",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "If data point name is a program variable.",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 0,
        "pattern":"^([-a-zA-Z0-9~@$()_+=\\{}\\.?: ]){0,1024}(?!['%*,<>`~\\^|#])",
        "method": "isVariableName(args)"
      }
    },
    {
      "id": "$2",
      "type": "TextField",
      "label": "Value",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter data point value",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Number",
        "disabled": false,
        "required": true,
        "min": 0,
        "max": 2147483647,
        "method": ""
      }
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Enter Return Variable",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "labelVarCheckbox": "",
      "argIndex": 0,
	  "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore",
      "validate": {
        "inputType": "Text",
		"pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,63}$",
        "disabled": false,
        "required": false,
        "min": 0,
        "max": 0,
        "method": "isValidVar(arg)"
      }
    }
  ],
  "name": "ns_user_data_point",
  "syntax": "int ns_user_data_point(char* data_point_name, double value)",
  "javaSyntax": "int ns_user_data_point(String dataPointName, double value)",
  "cEx": "void flow()\n{\n  ns_start_transaction(\"Home\");\n  ns_web_url(\"Home\",URL\u003d\"https:\/\/www.cavisson.com\");\n  ns_end_transaction(\"Home\",  NS_AUTO_STATUS);\n  int url_body_size \u003d ns_url_get_body_size();\n  // User can add response body size in ns_user_data_point API.\n  ns_user_data_point(\"RespBodySize\", url_body_size);\n}",
  "javaEx": "void Flow(NSApi nsApi)\n{\n  nsApi.ns_start_transaction(\"Home\");\n  nsApi.ns_web_url(\"Home\",URL\u003d\"https:\/\/www.cavisson.com\");\n  nsApi.ns_end_transaction(\"Home\",  NS_AUTO_STATUS);\n  int url_body_size \u003d nsApi.ns_url_get_body_size();\n  // User can add response body size in ns_user_data_point API.\n  nsApi.ns_user_data_point(\"RespBodySize\", url_body_size);\n}",
  "insertStrC": "ns_user_data_point(char* data_point_name, double value)",
  "insertStrJava": "ns_user_data_point(String data_point_name, double value)",
  "description": "Records a user-defined data sample."
}
