Export run results to InfluxDB or JSON

Using the Raw Results Exporter tool, you can export scenario results to an InfluxDB database, or to files in JSON format.

Exporting raw data to other formats is useful when, for example, the run results are too large for Analysis to handle, or when you want to use test data in applications developed for your specific needs.

About exporting data to InfluxDB

Exporting raw results to an InfluxDB database enables you to use the data in applications other than Analysis.

The data exported to InfluxDB is output to a running InfluxDB server. InfluxDB versions 1.8 and 2.x are supported.

To reduce the time spent collating and exporting data at the end of a scenario run, you can export data to an InfluxDB database during runtime. Use the option Automatically export results to InfluxDB in the Collate Settings dialog box. Refer to Collate scenario run results.

Controller supports two methods for exporting data to InfluxDB:

The data exported to InfluxDB is stored in the database in the following tables:

Table Description
Error The error events that occurred during the scenario run.
Transaction Complete transaction information.
TransactionBreakdown Transaction breakdown information.
VuserCount Vuser count during the scenario run.
DataPoint Datapoint information recorded during the script run.
MonitorDataPoint Datapoint information recorded by monitors during the run.
TransactionBreakdownTruClient TruClient transaction breakdown information, containing client-side measurements.

Tip: In your InfluxDB configuration file, we recommend you set max-values-per-tag= 0 to allow for unlimited values per tag. For details, refer to the InfluxDB product documentation.

Note: After data has been exported to InfluxDB, you can use a customized Grafana dashboard for visualizing the LoadRunner data. You can download the LoadRunner dashboard from Grafana.

Back to top

Export data to InfluxDB from the UI

You can execute the export of results data to InfluxDB from Controller.

To export run results to InfluxDB:

  1. In Controller, select Results > Influx Settings.

    The InfluxDB Settings dialog box opens.

  2. In the dialog box, configure the export:

    1. Select the relevant InfluxDB version.
    2. Define the Server URL. This is an external, customer server, and not part of the LoadRunner Professional system. Define the URL of the database server, and include the port number.

      For example: http://my-influx-url:8086

      HTTPS URLs are supported, as long as the appropriate certificates have been installed.

    3. Configure the rest of the information as relevant:
    InfluxDB 1.8 InfluxDB 2.x
    Database name Enter a name for the exported database. Organization ID The ID used in InfluxDB for your organization.
    Username and Password These settings must be completed if the InfluxDB server requires authentication; otherwise, they can remain blank. API Token The InfluxDB token that provides authentication to write to your bucket.
    Proxy fields Enter proxy server details, if relevant. Bucket name The name of the InfluxDB bucket where the data is stored.
  1. Save these settings. The settings remain in effect until changed.
  1. In the Controller menu, select Results > Export to InfluxDB.

    A notification pane opens. During the export, status and messages are displayed in this pane.

  2. When the export is complete, click Close.

Back to top

Export data to InfluxDB from the command line

You can export raw results data to InfluxDB from the command line.

Enter the following on the command line:

 LrRawResultsExporter -source_dir <folder_path>
     [-to_influx -influx_url <server url> -database <database name>] [-user <username> -password <password>]
     [-proxy_server <server url> -proxy_user <username> -proxy_password <password>]
     [-target_dir <folder_path> -to_json] 

Parameters:

Option Description

-source_dir

The location of the source file (.lrr) containing the scenario run results.
-to_influx Instructs the Exporter to export the raw data to InfluxDB.
-database The InfluxDB database name.
-influx_url

The InfluxDB server address, including the port number.

HTTPS URLs are supported, as long as the appropriate certificates have been installed.

-password The InfluxDB password.
-username The InfluxDB user name.
-proxy_url The proxy server address, including the port number.
-proxy_user The proxy username. Include if proxy requires authentication.
-proxy_password The proxy password. Include if proxy requires authentication.
-to_json Exports the data to the target directory in JSON format (see Export data to JSON). Data can be exported simultaneously to both JSON and InfluxDB.

Back to top

Export data to JSON

Exporting test results to files in JSON format enables you to use the data in applications other than Analysis.

The data exported to JSON is output to a folder, and contained in a set of files:

RunInfo.txt

Contains information about the scenario run that generated the processed raw results.

offline.txt Contains the offline monitor data recorded by the monitors set up in the scenario run.
offlineMetadata.txt Contains additional metadata for the offline monitor datapoints stored in offline.txt.
*.eve As in the original .eve files, these files contain all the information recorded from the run: transaction data, transaction breakdown data (including for TruClient), errors (script errors only), and web-related data points.

To export raw data in JSON format, enter the following on the command line:

LrRawResultsExporter -source_dir <folder_path> -target_dir <folder_path> -to_json [-f]

Parameters:

Option Description

‑source_dir

The location of the source file (.lrr) containing the scenario run results.
-target_dir -to_json Instructs the Exporter to export the raw data to JSON files in the specified target folder.

-f

Forces the execution of the application, automatically overwriting the target directory if it already exists.

Back to top

Excluding time zone information from exported data

By default, the result time zone information is included in the exported raw results data.

When exporting to InfluxDB or JSON, you can configure the export to exclude the time zone information.

To exclude the timezone:

  1. Open the <LoadRunner Professional root folder>\Analysis\LrRawResultsExporter.ini file. If the file does not exist, create a file by the name LrRawResultsExporter.ini in that location.

  2. Add the following line: IncludeResultTimeZone=0.

This setting is effective for:

  • Controller. If you set this configuration and then select Export to InfluxDB from the Controller user interface, the exported data will not contain the time zone difference. For details, see Export data to InfluxDB from the UI.

  • Raw Results Exporter. If you use the command line Raw Results Exporter tool to export raw data to Influx or JSON, the exported data will not contain the time zone difference. For details, see Export data to InfluxDB from the command line.

  • LoadRunner Enterprise. For LoadRunner Enterprise tests with InfluxDB enabled, if the change is made on the host machine used for exporting the result, the time zone difference is excluded. For details, see the LoadRunner Enterprise Help Center.

Back to top

See also: