Creating a performance test with Ruby or Taurus for BlazeMeter
Ok, so I’ve been so involved lately in designing performance tests reports for detecting potential performance or bottleneck issues in web applications that I’ve spent a lot of time evaluating different tools, some are great other have a lot potential as they are making innovative approaches for test execution and reporting.
But I ended up using for the specific project need a couple of tools around JMeter, which is a very well-known tool for aiding in the creation of performance test scenarios. Using a Java UI however is a bit tedious, at least for me so I investigated a bit if there was anything that could help us script the whole thing (yeah, I’m lazy).
The first one was a really cool ruby gem that’s called ruby-jmeter which is a little DSL around all the JMeter controllers, and let us generate JMX files. These JMX files are XML code that instructs JMeter how to behave for an specific scenario.
Here’s an example of such test,
I’m using the 2.13.x gem, the 3.x has many DSL changes so this may not work with 3.x I haven’t tested it yet. Ok so this generates a jmx file, this file can be loaded then in JMeter and executed locally or can also feed another super cool tool I’ve found that’s called, Taurus.
Taurus is a Python library and can be easily installed using pip, once it is installed and available in our PATH, the bzt command tool can be used to execute the JMX, if JMeter is not installed it will download it for us and it will expect a correct JAVA_HOME in the system.
Something cool about Taurus is that it has its own little language for defining tests instead of using JMX files, JMeter has a steep learning curve and might not be as easy for tests not that complex.
The following is the same JMX test I wrote above but this time I’m using Tauros test YAML file definition.
As you can see it’s super easy and it’s just matter of using the bzt executable Taurus provides to execute the test.
I hope you find it useful and help you get you started with performance test tools.