Search code examples
chartsjmeterbar-chartjmeter-pluginsjmeter-3.2

JMeter to record results on hourly basis


I have a JMeter project with multiple GET and POST requests and assertions for these. I use Aggregate results and View results tree listeners, but none of these can store results on hourly basis. I tried JMeterPlugins-Standard and JMeterPlugins-Extras packages and jp@gc - Graphs Generator listener, but all of them use aggregated data instead of hourly data. So I would like to get number of successful and failed requests/assertions per hour, maybe a bar chart would be most suitable for this purpose.


Solution

  • I'm going to suggest a non-conventional design-level solution: name your samplers dynamically with hour (or date and hour), so that each hour the name will change, and thus they will appear in different category, i.e.:

    enter image description here

    The code for such name is:

    ${__time(dd:hh,)} the rest of sampler name
    

    Such sampler will appear in the following way in Aggregate Report (here I simulated it with minutes/seconds, but same will happen with days/hours, just on larger scale):

    enter image description here

    Pros and cons of such approach:

    • Simple, you can aggregate anything by hour, minute, or any other time slice while test is running, and not by analysis after execution.

    • Not listener-dependant, can be used with pretty much any listener or visualizer

    • If you want to also have overall stats, it will require to sum up every sub-category. So it alters data, but in the way that it can still can be added back to original relatively easy.

    • Calculating __time before every sampler will not be unnoticed completely from performance perspective, but I don't think it will add visible overhead to a script.

    • You could get the same data by properly aggregating JTL or CSV (whichever you use) after execution, so it doesn't provide you with anything that is not possible to achieve using standard methods

    • Script needs altering to make this happen. if you have 100s of samplers, it's going to take a while. And if you want to change back...