top of page

Near-Real-Time Monitoring with Performator

Writer: Josef Mayrhofer
Josef Mayrhofer
5 days ago
3 min read

During critical performance tests, engineers need real-time visibility into key metrics to identify issues and verify that the test is running as expected. This requires a load testing tool that can analyze and report metrics while the test is still running.


Performator reports metrics every 15 seconds. This allows for near-real-time monitoring by storing the metrics in a database and fetching them with a dashboarding tool.


This blog post shows you how to use the dashboard template available in Performator. Make sure you already have a PostgreSQL database and Java 17 (or higher) installed.


Configuring the Postgres Reporter


First, register a database reporter to the Hierarchical Statistics Report (HSR) engine in order to report the metrics. Add a boolean “storeInDB” to toggle whether a test should be reported to a database. It is best turned off for tests solely used for debugging to prevent cluttering the database with irrelevant data.


public class Globals {
    public static void commonInitialization(boolean storeInDB) {
		if(storeInDB) {
			HSRConfig.addReporter(
				new HSRReporterDatabasePostGres(
					  "localhost"   // hostname
					, 5432          // port
					, "dbname"	
					, "hsr"			// table name prefix
					, "dbuser"
					, "dbpwd"
				)
			);
		}
    }
}

After a successful test, ensure the database tables with the specified table name prefix have been created. These metrics should also have been reported.



Installing EMP


Performator uses the Engineered Monitoring Platform (EMP) for dashboarding.

Because of EMP's powerful query language and flexible dashboarding capabilities, it allows for richer dashboards compared to other tools like Grafana.


Setting up the Engineered Monitoring Platform:


  1. Install Java 17 or higher

  2. Download the EMPServer.zip file of the latest release from its GitHub repository.

  3. Unzip the file.

  4. Use either start.sh or start.bat to start the EMP Server.

  5. Open http://localhost:8888 and log in with the credentials admin/admin.


If you want to set up EMP as a Windows Service that starts on system startup, we recommend using the Non-Sucking Service Manager(NSSM).


After you log in, you should see an empty list of dashboards:



Connecting to the Database


To connect EMP to our database, go to “Menu Bar >> Admin >> Context Settings”.


On the Context Settings page, click “Add >> Postgres Environment”:



Provide a name and connection details, and click “Add”. If the connection is successful, you will see the following: “Context Settings created successfully“.



Importing the Dashboard Template


Next, go to “Menu >> Tools >> Dashboards >> My Dashboards” and click the import button.


Import the template file “EMP_Dashboard_Postgres_Advanced.json” that can be found in the Performator-Quickstart project under ./docs/templates:



Since the imported dashboard doesn't yet know which connection to use, it will show a "postgres environment does not exist" exception on the first opening.


Click on “Edit” and then on “Params”. Set the two values for the database connection and the table prefix, click Save.



Select your test in the dashboard parameters and click Update to load its metrics. The dashboard displays a range of charts and tables, and further down, you can compare the results with those of another test.




Conclusion


You now have a database in place that Performator can report its metrics to, along with a dashboarding solution that allows you to view the data as soon as it is written to the database. Together, these give us near-real-time monitoring of our performance tests.

If you would like to learn more about using Performator for your load testing needs, contact our experts at Performetriks today. We look forward to helping you along this journey.

Happy Performance Engineering! #LoadTesting #Performance #SoftwareEngineering


Comments


bottom of page