Dockerised Jmeter + Grafana + Influxdb


Jmeter is a widely used load testing tool from Apache. It is open source.

Influxdb is a widely used time series database from InfluxData. It is open source.

Grafana is a widely used graphing and analytics engine from Raintank inc. It is open source.

Docker is a platform designed to containerize applications and services. It has a free tier but is not open source.

Jmeter has always lacked the same richness of features provided by many of its competitors in terms of user interfaces, usability and accessibility. In my opinion, it has always particularly lacked the results analysis and reporting capabilities found in such tools as Loadrunner for example.

It does provide raw results in common formats, but it has always been left to the performance test community to implement any analysis functions within a jmeter-driven framework.

This is undoubtedly a limitation, but at this price point, it feels rude to complain.

Implementing Iteration Pacing in jMeter

Jmeter is an excellent tool for performance testing, especially given the price. It does however have a small number of limitations. One of those is the lack of a decent analysis, results and reporting engine – which I guess is why a lot of companies use Blazemeter as their testing component.

Another limitation in my eyes is the lack of a flexible iteration pacing controller.

If we build a load model allowing 45 seconds for an iteration, but that iteration takes 15 seconds, there’s is no built-in method to tell jMeter to wait 30 seconds on this thread. This is compounded by additional threads since they either all have to wait an arbitrary length of think-time which minimises the concurrent activity, or they don’t wait and the system is under higher loads than specified for the test.

Loadrunner Parameters in Blocks not updating?

I’ve encountered an issue recently where in a loadrunner script, I wanted to execute a number of requests of one type, followed by a number of requests of another type, followed by a number of requests of a third, and subsequently fourth and final type.

The whole thing is four blocks looping in sequence inside an outer loop of iterations in Loadrunner Vugen.

Centralised Testing Functions – Oversight and Governance

I’ve been working on a project over in Sweden, and have found it unlike anything I’ve ever seen before. Sadly, this is for all too familiar reasons.

I work for an organisation with a small performance testing function centralised across all the projects that can be conjured up. As a result, there are often a lack of resources available to conduct testing, or even to conduct an assessment of whether testing is necessary and appropriate. The knock-on effect of this is that large third party consultants are drafted in to pick up the bigger projects and the centralised testing function – the Test Center – take a back seat.

In practice, that back seat is often in a different vehicle, and so the Organisation as a whole lose ownership and governance of their own IT projects, ceding it to the consultants.

It is in the nature of the larger consultancies to be concerned with one thing only – Successful Delivery. It is a known side effect of this concern that the contracts will often be drawn up to include bonuses and interim payments based on successful delivery.

In many ways this is absolutely fine, but it requires an oversight position from the test center to conduct reviews upon such deliverables as:

  • the test approach
  • the test scripts
  • the test results
  • defects
  • the deployment decision

The question is: What happens when you have an immature IT organisation, who have ceded control of the project to a large 3rd party supplier – focused on delivery at all costs – with no checks and balances in place to ensure the quality of that delivery.

Python Functions

Declaration of functions in Python is nice and simple.

def my_function():
print("Hello From My Function!")

The call is also uncomplicated

my_function()

With Arguments

def sum_two_numbers(a, b):
return a + b

sum_two_numbers(10,8)

Python Basics

The absolute basics:

Strings

print("Goodbye, World!")
x = "string value"
print (x)

Integers

myint = 7
print(myint)

Floats

myfloat = 7.0
print(myfloat)
myfloat = float(7)
print(myfloat)

Extending Loadrunner Scripts with C – Function Library #1.2

I have now left the Cardiff JMeter role, and returned to Loadrunner work, this time in Dublin.
With every new position I find myself re-invigorated to learn new things, update old code and write some articles for the site.
I have a lot of ideas in my head at the moment, but my shower thoughts this morning were to finally transform the writeToOutputFile function into exactly that, a function.

Jumping Ahead with JMeter

A new article in the dev diary describes how I’ve gone about creating a fully automated performance test suite using jmeter for my latest clients. A further article will shortly appear here, although my concept of shortly may be somewhat different to most.

In any case I have plans to document the process of constructing JMeter test plans and fragments and then to document how to extend that into a full suite of tests, and then how to execute that without a lot of manual intervention, and potentially, I may revisit running that without ANY manual intervention So there’s that to look forward to in 2015, hopefully in Q1.

String Manipulation with VBA

As a performance tester, most data arrives at me in a spreadsheet, or an enormous text file with little or no delimitation.

The previous article showed how to parse across columns and down rows to gather data.

Excel has a number of built in functions to manipulate that data before outputting it for us.

Functions like

MID To pull a child string from a parent string specificied by the number and position of characters
LEFT / RIGHT Similar to mid, but from either the 1st or Last character in the string
TRIM Removes whitespace from the ends of strings (both ends)

These help immeasurably in cleaning up the data.

Tied into further functions like

We have the facility to parse through raw data, picking up the elements we need and outputting them in the form we require. Given that loadrunner uses .dat or .csv files for test data input, this is hugely useful.

Instr is specifically used within VBA, the other functions mentioned can also be used at the worksheet level and embedded into formulae.

Instr Search inside one string for another

Excel as an IDE

I’ve often found, especially when starting at a new client, that real development tools aren’t provided for testers (even automation testers) as standard and have to be requested from the helpdesk. This can take a week or longer to sort out, depending on efficiency. It’s worse in financial institutions who seem to think Admin rights are golddust, who lock down online storage and usb ports, who scan and validate every email. That’s their prerogative, but if you’re going to pay me to do my job, maybe make it so I actually can rather than putting security in the way. A lot of it is foolish, I ask for read access to a customer database in a test environment. Now as long as you’re not using live customer data, there’s virtually no risk to granting that, it’s a 5-minute job – so why does it alway’s take a week and 3 managers to approve it?

In any case, my workaround for this is MS Excel.

There are a number of reasons for this:

  • Because of the structure of a workbook, and a worksheet, into tabs, rows and columns, it’s easy to visualise data structures like lists and arrays.
  • Because rows and columns provide an easy structure to navigate around in code
  • Because I have used Visual Basic for a long time, and Excel’s VBA is probably the easiest variant of this to use
  • Because every client I’ve ever been to has Excel.
  • Because you don’t need admin rights to run macros’ typically.
Powered by WordPress and ThemeMag