GEE [Jmeter-ec2] – video tutorials part 2

Hi All,

I just added few more videos showing how to configure your test environment to run your JMeter tests:

  • locally on a Vagrant box
  • using remote machines
  • and on Amazon EC2

04 – create a first test plan, run it using Gee and a vagrant box
Shows how to create a new test plan from a template project. Then how to run it using GEE on our local vagrant box.

05 – configure passwordless ssh access to a linux box
Shows how to configure a passwordless SSH access to a remote Linux box. Such access is required by Gee to run your JMeter tests on a remote machine.

06 – automatically install JMeter with plugins on a remote machine
Shows how to use script to download JMeter and JMeter-plugins automatically on a linux host that will be used by GEE to run your load tests.

07 – run your JMeter test on remote linux hosts
Shows how to configure GEE and remote Linux hosts to run your JMeter tests. This video might come handy when you’d like to run your tests using internal network resources.

08 – run your JMeter test on Amazon EC2
Shows how to configure GEE to run your JMeter tests using Amazon EC2 services.

GEE [Jmeter-ec2] – video tutorials part 1

I finally started recording videos explaining how to use Gee.
Gee is a tool based on a JMeter-EC2 project by Oliver Lloyd.
It allows you to run JMeter tests on:

  • Amazon EC2
  • Vagrant boxes
  • Linux hosts

Running your tests using this tool is better than using the standard distributed mode in Jmeter, because it doesn’t require constant communication between the master node and slave nodes.

Here are first few videos explaining how to clone the project, spawn new vagrant box and finally how to run an example project on that virtual box.
Hope you all will find in useful 🙂

GEE [Jmeter-ec2] – 01 – cloning the project

GEE [Jmeter-ec2] – 02 – initialize vagrant box

GEE [Jmeter-ec2] – 03 – running an example test on a vagrant box

Monitoring JVM metrics via JMX managemnet interface in JMeter

What do we need:

Once you have plugins installed them in the jmeter’s/lib/ext folder, then:
1 – On the box you want to monitor, copy templates: jmxremote.password & jmxremote.access from $JAVA_HOME/lib/management to for example: /srv/play/
2 – edit them according to your liking
3 – launch your JAVA application with additional parameters:

java -jar your_application.jar

4 – start a server-agent ( on the host which JVM metrics you want to monitor using command like:

cd ${jmeter_folder}/lib/ext/
java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 0 --tcp-port 7777

You can also run it as background process and detach from your session, so it will continue to work even if you disconnect from the server.

cd ${jmeter_folder}/lib/ext/
nohup java -jar ./CMDRunner.jar --tool PerfMonAgent --udp-port 0 --tcp-port 7777 &

5 – add “PerfMon Metrics Collector” to your test plan
6 – provide the hostname/IP address of the box running server-agent in the “Host/IP” field (don’t forget about the port 🙂 )
7 – select JMX as the “Metric to collect”
8 – double click on “Metric parameter” field and then click on the “…” button to the right
9 – enter all the credentials that the server-agent will use to connect to the local JVM via JMX port. Here’s an example config:


where role & password are of course defined in the jmxremote.password & jmxremote.access files

btw. Here’s an example test plan with preconfigured PerfMon listener.

If everything was configured properly the you should see something like that on the PerfMon graph:

example PerfMon graph with JVM Metrics

example PerfMon graph with JVM Metrics

How to randomly inject or not something to the request in JMeter

Nothing really special today, but maybe someone will find it handy 🙂

Sometimes when I want to test if my script is handling various server responses properly, I’m preparing a request that will randomly malform itself or not.
This can be accomplished by randomly injecting something into the URL or msg body.

A simple way to do that is to use a JS or BeanShell script, like this one:

${__javaScript(if(!! Math.round(Math.random() * 1)) {"injectedText";} else {"";} )}

An example HTTP request that will randomly malform itself 🙂

Randomly Inject Something To The URL

Randomly Inject Something To The URL

How to save the log file in the same folder as jmx file

Hi All,

I’ve been struggling today to save Aggregate Graph’s log file in the same directory as the project file.
Finally after 2h of crawling thru google I’ve sorted that out by myself.

All you need to do is to use such a simple and obvious thing like tilde “~” and put it before your desired log file name 🙂


this is how you can save your log file in jmx's home directory

this is how you can save your log file in jmx’s home directory

Hope you’ll find it helpful.