Brew Jmeter



Once you’ve installed with homebrew, you may be lost with JMeter configuration files as the folders differ a bit, so here is the mapping from Core JMeter to Homebrew installed JMeter: Item Standard JMETER. Brew install ansible brew install terraform brew install jmeter You can just run them from your own machine. The full codebase is available on Github at RisingStack/distributed-loadtests-jmeter for your convenience. Why do we use Jmeter for distributed load testing? Using JMeter in Linux is the same as in Window; you simply run the following shell script. Run the script file jmeter (This file has no extension)- run JMeter (in GUI mode by default). Run the script file jmeter-server - start JMeter in server mode (calls JMeter script with appropriate parameters).

When placed side-by-side, Google's search stats by country (as of July 15, 2014) reveals differences by country:

Despite state-imposed limitations on use of Google search, more people from China (perhaps using proxy servers) used Google to search for LoadRunner than even India, where legions of outsourcing employees live. So interest in China must be much larger than indicated. That's not hard to imagine because 9 of the top 25 websites in the world are for China. Alibaba.com has more business than Amazon and EBay combined.

Curiously, search for JMeter in China is only a third of interest in India. Yet HP seems to be investing most of its LoadRunner marketing efforts in the US, when the United States account of just 17% of what China has. Click on 'View Changes over time' control on the Google page and note that interest from China surged to the top during the 2nd half of 2013.

Meter

The disparity of general population size versus interest in JMeter is strongest in Japan, and not on the LoadRunner country list at all.

Brew Jmeter

As we all know that Most of the Companies are investing in best resources instead of licensed tools and moving towards open source technologies, We as a Performance engineers also has to adopt and utilize open source tools and technologies.

It is quite difficult to store JMeter test results for longer duration and to monitor JMeter test in non-gui mode. One of the solution is Grafana and InfluxDB.

In this article, I will explain step by step, how to install and configure Grafana and InfluxDB with JMeter in MAC and Windows OS.

InfluxDB Setup with JMeter

Brew Jmeter

Windows OS

  1. First we have to download InfluxDB using following URL Download InfluxDB
  2. Unzip the downloaded file. You will see the folder structure like below

3. Open influxdb.conf file and scroll down till graphite section. You will find like below

4. Uncomment few configurations highlighted in below screenshot and change the value of enabled tag to true

5. Execute influxd exe from downloaded folder. This is to start the InfluxDB service.

6. Execute influx exe from downloaded folder to connect to Influx DB and create a database schema

7. Execute below commands to create a new database schema

  • create database jmeter_demo; (jmeter_demo is the database schema name)
  • show databases;

8. Next step is to add a backend listener in JMeter to send test stats to InfluxDB during execution. Do the configuration same as below screenshot. (Here 8086 is default port used by InfluxDB for web access)

  • influxdbURL --> It should be the URL where InfluxDB is hosted followed by database name.
  • application --> Mention any name to identify multiple applications test results.
  • measurement --> Here jmeter is the table name where all the test stats will be written.
  • samplersRegex --> .* will write all the transaction data into InfluxDB.

Make sure you are selecting InfluxDB backend listener client in Dropdown as below:

9. Now JMeter is successfully configured to send data stats to InfluxDB.

  • To validate stats in Influx DB, Run a JMeter test and open influx exe application from downloaded folder

Execute following commands

  • use jmeter_demo (Here Jmeter_demo is the database name which we created in step 7).
  • select * from jmeter; (Here jmeter is a table name)
  • you will be able to see the data in InfluxDB like below

MAC OS

Option

It is quite easy to install InfluxDB and Grafana in MAC if you have Homebrew installed in your system. if not, Download Brew.

  1. Execute below commands to download InfluxDB
  • brew update
  • brew install influxdb

2. Run below commands after successful installation of InfluxDB

  • ln -sfv /usr/local/opt/influxdb/*.plist ~/Library/LaunchAgents
  • launchctl load ~/Library/LaunchAgents/homebrew.mxcl.influxdb.plist

3. To Verify that InfluxDB is running or not, Execute below commands in terminal

  • Influx
  • SHOW DATABASES
  • Create database jmeter_demo

4. Make few changes in the InfluxDB configuration file. File Path --> /usr/local/etc

  • influxd config
  • Refer step 4 in windows configuration as it is same.

5. Restart Influx DB

  • brew services restart influxdb

6. Refer step 8 and 9 from windows installation to add a backend listener in Jmeter.

-----------------------------------------

Now as the data is reaching to InfluxDB successfully, Next step is to download Grafana and setup dashboard.

Download Grafana

Windows OS:

  1. Download Grafana
  2. Unzip the downloaded file, go to bin folder and run the grafana-server exe. It will start the grafana server and then you can setup InfluxDB in it.

Note: influxd and grafana-server should be running always to push the JMeter data to InfluxDB and to access Grafana portal.

Mac OS:

  1. Execute below commands
  • brew install grafana
  • brew services start grafana

----------------------------------

Brew Jmeter Gui

Setup Grafana and Dashboards

  1. To access Grafana, use http://localhost:3000/ (Grafana by default use 3000 port).
  2. login in Grafana using admin/admin as username and password.
  3. It will ask for password change, You can use the same admin as password.
  4. Next step is to add InfluxDB data source in Grafana.
  5. click on add data source.
  6. select InfluxDB and enter all the details as per below screenshot and click save. Make Sure you are giving 'Jmeter' in Name textBox as below reference dashboard is using datasource called 'Jmeter'.

7. Now InfluxDB is connected to Grafana, Next step is to create a dashboard to view test stats in graphical view.

  • Go to dashboard home.
  • Click on new dashboard. Here you can add multiple panels like graphs, tables etc..
  • Click on graph then click on edit in panel title in the chart heading.
  • Now you can write a query to fetch the required data from InfluxDB like below (Here jmeter represents table name and field(avg) represents average transaction response time).

Grafana Dashboard for JMeter test

I have created a dashboard to monitor JMeter test results. You can import it using following steps.

  • Click on Dashboard --> Manage --> Import
  • Download Dashboard JSON from following Git repository and click load.
  • Make sure Datasource name is set to 'Jmeter' and save.

I hope you will find this article helpful. You can reach out to me if you face any issues while configuring Grafana.