...
Script: attachment:jtlmin.sh.txt BR JMeter's output graph is too granular to depict throughput for extended test intervals (anything from 2 to 24 hours). An Excel constraint its maximum of 65536 rows. So to produce a throughput graph, JTL files of ~100k rows should be summarized into increments of 1 minute (or 2,5,n minutes depending on requirements).
BRFor each minute: throughput = count of transactions in that minute ; response time = average of 'elapsed' values in that minute. BRThe script jtlmin.sh
summarizes large JTL files into 1 minute increments producing an OUT file that can be imported to Excel and a graph produced, as above. Example. The core functionality in jtlmin.sh
is this piece of awk code:
No Format |
---|
$ jtlmin.sh Usage: jtlmin.sh <filename> Summarizes JMeter # scan a JTL outputfile intofor records in a specified interval # and return record count & average response time. BEGIN { avgresponse=0; sumresponse=0; trancount=0; } { if(($1 >= lastmin) && ($1 < thismin)) { trancount++ sumresponse += $2 avgresponse = sumresponse / trancount } } END { printf("%d %d %d %d",lastmin,sumresponse,trancount,avgresponse); print " ",strftime("%Y.%b.%d %H:%M",lastmin) } |
An example session, using jtlmin.sh
to process a JTL file. The file produced, queryBalance.jtl.OUT
, can now be used to produce throughput graph. Response times can also be included on the secondary axis, as in the diagram above. These graphs were very good at showing when the integration layer was slow to respond and when throughput varied from the original JMeter plan.
No Format |
---|
$ jtlmin.sh Usage: jtlmin.sh <filename> Summarizes JMeter JTL output into 1-minute blocks $ jtlmin.sh queryBalance.jtl Processing queryBalance.jtl $ ls q* queryBalance.jtl queryBalance.jtl.OUT $ head queryBalance.jtl.OUT /c/jmeter/performance/Myserver/output/queryBalance.jtl unixtime date time thruput(tpm) response(ms) 11603549401-minute blocks $ jtlmin.sh queryBalance.jtl Processing queryBalance.jtl $ ls q* queryBalance.jtl queryBalance.jtl.OUT $ head queryBalance.jtl.OUT /c/jmeter/performance/Myserver/output/queryBalance.jtl unixtime date time thruput(tpm) response(ms) 1160354940 2006.Oct.09 13:49 65 0 1160355000 2006.Oct.09 13:50 0 0 1160355060 2006.Oct.09 13:51 0 0 1160355120 2006.Oct.09 13:52 56 0 1160355180 2006.Oct.09 13:53 98 108 1160355240 2006.Oct.09 13:54 84 125 1160355300 2006.Oct.09 13:55 0 0 1160355360 2006.Oct.09 13:5649 065 0 |
The core functionality in jtlmin.sh
is this piece of awk code:
No Format |
---|
1160355000 2006.Oct.09 # 13:50 scan a JTL0 file for records in a specified interval0 1160355060 # and return record count & average response time. 2006.Oct.09 13:51 0 BEGIN { 0 1160355120 avgresponse=0; sumresponse=0; trancount=0; 2006.Oct.09 13:52 56 } { 0 1160355180 if(($1 >= lastmin) && ($1 < thismin)) { 2006.Oct.09 13:53 98 trancount++108 1160355240 2006.Oct.09 sumresponse += $2 13:54 84 avgresponse = sumresponse125 1160355300 / trancount 2006.Oct.09 } 13:55 } 0 END { 0 1160355360 printf("%d %d %d %d",lastmin,sumresponse,trancount,avgresponse); 2006.Oct.09 13:56 print " ",strftime("%Y.%b.%d %H:%M",lastmin) 0 }0 |