Guest blog post by Or Marom
Performance Center R&D
Micro Focus Performance Center 12.60 has added an integration with InfluxDB. InfluxDB is an open source time series database that provides very good input/output capabilities, and has great disk storage efficiency. This integration enables you to set up a connection with InfluxDB, and assign it to your projects.
Each assigned project automatically exports all the data available during an online run to the configured InfluxDB. Exporting online data in this way provides lots of useful new capabilities including:
- Live alerting
- Trending between runs
- Data mashing with other tools using Grafana dashboard
We are also planning an option to streamline raw data exported to InfluxDB.
This post explains how to set up the Performance Center integration with InfluxDB, and view performance test run data in the Grafana dashboard.
How to set up the Performance Center and InfluxDB integration
Below, I explain how to set up InfluxDB on a Windows platform (while InfluxDB recommend using Linux for better performance, Windows binaries work very well in my experience):
- Install an InfluxDB node:
a. Go to https://portal.influxdata.com/downloads and download InfluxDB (for this tutorial, I will be referencing the Windows binaries).
b. Extract the files to a local directory, for example c:\influxDB
c. Open the influxdb.conf file using a text editor.
i. Uncomment the preference auth-enabled = false by removing the ‘#’ before this line.
ii. Set this preference to true: auth-enabled = true
d. Run the following command from the command line: influxd.exe –config <full path of install dir>\influxdb.conf
- Set up authentication:
a. Install Advanced REST Client, or any other REST API tool that you can use to communicate with the machine on which you installed InfluxDB.
b. Send the following request to make sure you can communicate to Influx GET - http://<hostname>:8086/ping
i. You should get a 204 No content response.
ii. In case of failure, check that the InfluxDB host has port 8086 open for both incoming and outgoing traffic.
c. Send the following request to configure an admin user on InfluxDB POST - http://<hostname>:8086/query?q=CREATE USER admin WITH PASSWORD 'password' WITH ALL PRIVILEGES
- This request is mandatory by InfluxDB once you enable authentication. The first request needs to be to create an admin user.
- An InfluxDB server can have multiple internal databases under it; each database can have users with authorization (read/write) access to a specific database. For the integration with Performance Center, it makes sense to create a database for each domain and project. To avoid creating multiple users with individual permissions for each database, I recommend creating another admin user, which will be specific to Performance Center. The user and password are stored encrypted in the Performance Center database. Send the following request to configure a PC admin user on InfluxDB POST - http://<hostname>:8086/query?q=CREATE USER “pc_influx_admin” WITH PASSWORD 'password' WITH ALL PRIVILEGES
- Set up internal databases and authorization:
a. Send the following request to create a database under the InfluxDB: http://<hostname>:8086/query?q= CREATE DATABASE "DEFAULT_DEMO_PROJECT"
b. If you want to create a separate user for each database with read/write privileges instead of using a PC admin user, run the following POST queries:
i. http://<hostname>:8086/query?q=CREATE USER <username> WITH PASSWORD '<password>'
ii. http://<hostname>:8086/query?q=GRANT ALL ON " DEFAULT_DEMO_PROJECT " TO "<username>"
- Set up a retention policy
InfluxDB uses retention policy groups under each database. Each retention policy group can be set so that the data under it is deleted after a set time period. Influx has a default RP group with no data expiration (data is kept forever).
Since Performance Center automatically writes data into the default group, I strongly recommend setting up a new default RP group for each database with a reasonable expiration. If your load test generates large amounts of named transactions (for example, in the Transaction per second graph you have 5000 measurements), I recommend an RP of a few months. Influx limits 1 million series per database (max-series-per-database = 1000000 in the configuration file). Performance Center “tags” each point with the run ID, which means that each time you run a test, it creates a new series on the database. Eventually you will reach the 1 million mark, unless you use a retention policy to delete the data.
Use the POST query http://<hostname>:8086/query?q=CREATE RETENTION POLICY “pc_default_rp” ON <database_name> DURATION 90d REPLICATION 1 DEFAULT This will create a default RP in which all data coming from Performance Center will be stored for 90 days.
For more on InfluxDB administration, see https://docs.influxdata.com/influxdb/v1.6/administration/authentication_and_authorization/
For more on InfluxDB database management, see https://docs.influxdata.com/influxdb/v1.6/query_language/database_management/
- Set up the InfluxDB connection inside Performance Center:
a. In Performance Center Admin (http:<pc-server>/admin) there is now a new tab called Analysis Servers.
b. Click the ‘ ’ sign in the top left to create a new connection.
c. Enter the connection details (see the example below) and click Test Connection. Click the Assign button on the bottom of the screen and assign one or more projects to the connection.
Note: I recommend setting up a connection per project. While multiple projects can share one influx node since it can accept around 500K points a second, but storing all projects data in the same internal database can lead to administration difficulties if you want to expose the data to end users using Grafana for example.
d. After assigning the project, click Save.
Set up Grafana integration
- Run a load test on the project you have just connected. Data from this project should start populating InfluxDB.
- View the data using Grafana:
a. Download and install Grafana.
i. On Windows, extract the files to a directory.
ii. From a command line, run the file “grafana-server.exe –homepath <full path to root directory you unzipped the Grafana files>
b. Open a browser, and type the following: http://<Grafana host>:3000 (the default login is admin/admin).
c. Download the Performance Center–Grafana dashboard from here, and import it into your Grafana server.
d. Set up a new Grafana Data source connection to your InfluxDB (similar to the process for defining a connection in Performance Center).
e. Open the Grafana dashboard and select the data source. You should see your run data.
f. Note that the mandatory tag grouping is MeasurementName and MachineName. The field key ‘value’ is where the data is stored. Other fields are used in the Performance Center anomaly detection feature.
Note: When an InfluxDB connection is configured, Performance Center opens the offline display of the run dashboard using data from the InfluxDB connection.
If no InfluxDB connection was available during the run, or is not available when accessing the offline run dashboard, Performance Center uses the data stored on the Controller.
To set the data retention policy on Controller machines, go to Performance Center Administration > Hosts, and click PC Host Settings.
This new integration lets you easily share Performance Center test run data with others, and enables mashing up your test data with other data vendors.
InfluxDB also provides numerous post-analysis capabilities and alerting benefits. Utilizing these capabilities is the topic of my next blog.