{
  "synLogic": "int $ret \u003d $api($1);",
  "help": "The ns_get_transaction_time returns the duration in seconds of the specified transaction. You use this api to determine the total transaction time till any point of time",
  "notes": "",
  "returns": "Returns the duration in seconds for a specified transaction.<br >However, if an invalid transaction name is passed to the function, it will return the error code NS_TX_BAD_TX_NAME (-2).<br />Similarly, if the specified transaction is not currently running and therefore its duration cannot be retrieved, the function will return the error code NS_TX_NOT_RUNNING (-5).",
  "arguments": "",
  "parameterization": "Standard parameterization is not available for this api",
  "component": [
    {
      "id": "$1",
      "type": "TextField",
      "label": "Transaction name",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "Transaction name is of maximum 1024 characters.\r\nFirst character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore ",
      "placeHolder": "Transaction Name",
      "isDisabled": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z][a-zA-Z0-9_]{0,1023}$",
        "required": true,
        "min": 0,
        "max": 0
      },
      "quotes": true
    },
    {
      "id": "$ret",
      "type": "TextField",
      "label": "Return Variable",
      "value": "",
      "css": "p-grid p-align-center w-100-p",
      "title": "First character must be Alpha.\r\nOther characters are Alpha, Numeric or Underscore",
      "placeHolder": "",
      "style": "",
      "isDisabled": "",
      "argIndex": 0,
      "validate": {
        "inputType": "Text",
        "disabled": false,
        "pattern": "^[a-zA-Z_][a-zA-Z0-9_\u003e]{0,63}$",
        "required": false,
        "min": 0,
        "max": 0
      },
      "quotes": true
    }
  ],
  "name": "ns_get_transaction_time",
  "syntax": "int ns_get_transaction_time (char *tx_name)",
  "javaSyntax": "int ns_get_transaction_time(String txName)",
  "jsSyntax": "ns_get_transaction_time(txName: string)",
  "cEx": "flow()\n{\n  double trans_time;\n  ns_start_transaction (\"AddToCart\");\n  ns_web_url (\"getcart\",\n    \"URL\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\",\n  );\n\n  // Get transaction time to this point \n  trans_time\u003dns_get_transaction_time(\"AddToCart\");\n\n  if (trans_time)\n    ns_log_msg(\"The duration up to the cart is %f seconds\", trans_time);\n  else\n    ns_log_msg(\"The duration cannot be determined.\");\n}",
  "javaEx": "public class flow implements NsFlow\n{\n  public int execute(NSApi nsApi) throws Exception\n  {\n    double trans_time;\n    nsApi.ns_start_transaction (\"AddToCart\");\n    nsApi.ns_web_url (\"getcart\",\n      \"URL\\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\",\n    );\n\n    // Get transaction time to this point \n    trans_time \u003d nsApi.ns_get_transaction_time(\"AddToCart\");\n    if (trans_time)\n      nsApi.ns_log_msg(\"The duration up to the cart is %f seconds\", trans_time);\n    else\n      nsApi.ns_log_msg(\"The duration cannot be determined.\");\n  }\n}",
  "jsEx": "    double trans_time;\n    nsApi.ns_start_transaction (\"AddToCart\");\n    nsApi.ns_web_url (\"getcart\",\n      \"URL\\u003dhttps:\/\/184.105.52.73:4444\/ProductUI\/productSummary\/cartsummary\",\n    );\n\n    // Get transaction time to this point \n    let trans_time \u003d nsApi.ns_get_transaction_time(\"AddToCart\");\n    if (trans_time)\n      nsApi.ns_log_msg(\"The duration up to the cart is %f seconds\", trans_time);\n    else\n      nsApi.ns_log_msg(\"The duration cannot be determined.\");\n",
  "insertStrC": "int ns_get_transaction_time (char *tx_name);",
  "insertStrJava": "int ns_get_transaction_time(String txName);",
  "insertStrJs": "ns_get_transaction_time(txName: string);",
  "description": "Returns the  duration (process time) of a transaction"
}