I’m generating some load test results with jmeter and it outputs nicely formatted csv file, but now I need to do some number crunching with ruby. An example beginning of the csv file:
threadName,grpThreads,allThreads,URL,Latency,SampleCount,ErrorCount
Thread Group 1-1,1,1,urlXX,240,1,0
Thread Group 1-1,1,1,urlYY,463,1,0
Thread Group 1-2,1,1,urlXX,200,1,0
Thread Group 1-3,1,1,urlXX,212,1,0
Thread Group 1-2,1,1,urlYY,454,1,0
.
.
.
Thread Group 1-N,1,1,urlXX,210,1,0
Now, for statistics I need to read the first line of each thread group, add the Latency fields up and then divide with the amount of thread groups I have, to just get an average latency. Then iterate to the second line of every thread group and so forth..
I was thinking that maybe I would need to write some temporary sorted csv files for each thread group (the order of the url’s are hit is always the same within a thread group) and then use those as input, add first lines, do math, add second lines until there are no more lines.
But since the amount of thread groups change, I haven’t been able to write ruby so that it could flex around that… any code examples would be really appreciated 🙂
[update] – Is this what you want, I wonder?
How about this – it’s probably inefficient but does it do what you want?
Should return something like: