Attachment 'jtlmin.sh.txt'

Download

   1 #!/bin/sh
   2 # jtlmin.sh :
   3 #   JMeter log processing script 
   4 #   Collects & Averages throughput data using 1-minute increments
   5 #   Requires CSV-formatted log from JMeter "Simple Data Writer".
   6 #
   7 #   Version   Date          Author      Comment
   8 #       2.0   2009-02-17    R. Papesch  Refined awk procedure, renamed variables
   9 #       1.0   2006-11-28    R. Papesch
  10 
  11 #set -x  #debug
  12 
  13 USAGE="Usage: jtlmin.sh <filename> \nSummarizes JMeter JTL output into 1-minute blocks"
  14 [ $1 ] || { echo -e $USAGE; exit 1 ; }
  15 echo -e "Processing \c"
  16 ls $1 || { exit 1 ; }
  17 
  18 main()
  19 {
  20   WORKFILE=$1.jtlmin.$$.WORKING
  21   OUTFILE=$1.jtlmin.$$.OUT
  22   STEP=60       # <-- can modify this value for larger time increments
  23 
  24   # Workfile: Chop milliseconds, Round timestamps to nearest Minute
  25   sed -n '2,$ p' $1 | cut -c -10,14- | sort | awk -F',' -v step=$STEP '{print $1-$1%step,$2}' > $WORKFILE
  26 
  27   echo "Outputting data to $OUTFILE .."
  28   echo "$PWD/$1" > $OUTFILE
  29   echo -e "unixtime \tdate \ttime \tthruput(tpm) \tresponse(ms) " >> $OUTFILE
  30   awk_routine | sort >> $OUTFILE
  31 
  32   rm $WORKFILE
  33 }  
  34 
  35 awk_routine()
  36 {
  37   awk '
  38     NR!=1 {minute[$1]++; rsum[$1]=rsum[$1]+$2}
  39     END {
  40       for (i in minute) {
  41         printf("%d\t", i);
  42         printf("%s\t", strftime("%Y.%b.%d",i));
  43         printf("%s\t", strftime("%H:%M",i));
  44         printf("%d\t", minute[i]);
  45         printf("%d\n", rsum[i]/minute[i])
  46       }
  47     }' $WORKFILE 
  48 }
  49 
  50 main $*
  51 

Attached Files

To refer to attachments on a page, use attachment:filename, as shown below in the list of files. Do NOT use the URL of the [get] link, since this is subject to change and can break easily.
  • [get | view] (2005-03-22 06:25:53, 42.5 KB) [[attachment:DummyWebsitePerformance.JPG]]
  • [get | view] (2007-07-20 13:59:01, 9.5 KB) [[attachment:JMeterSummary.java]]
  • [get | view] (2007-07-20 13:59:37, 1.3 KB) [[attachment:JMeterSummaryOutput.txt]]
  • [get | view] (2008-04-21 05:39:22, 7.4 KB) [[attachment:cm_AdressService_throughput.png]]
  • [get | view] (2008-04-21 05:39:44, 6.2 KB) [[attachment:cm_AdressService_users.png]]
  • [get | view] (2008-04-21 05:39:54, 4.7 KB) [[attachment:cm_ChartStacked.png]]
  • [get | view] (2008-04-21 05:40:03, 5.7 KB) [[attachment:cm_ChartStackedPct.png]]
  • [get | view] (2008-04-21 06:27:06, 7.7 KB) [[attachment:cm_entire_throughput.png]]
  • [get | view] (2008-04-21 06:26:45, 6.0 KB) [[attachment:cm_entire_users.png]]
  • [get | view] (2008-04-21 07:01:30, 6.8 KB) [[attachment:cm_entire_users_range.png]]
  • [get | view] (2008-04-21 07:02:51, 6.7 KB) [[attachment:cm_entire_users_stddev.png]]
  • [get | view] (2008-04-21 05:40:12, 83.3 KB) [[attachment:cm_jmeter.png]]
  • [get | view] (2010-03-26 02:44:39, 16.8 KB) [[attachment:jmetergraph.pl]]
  • [get | view] (2010-11-05 01:17:23, 17.7 KB) [[attachment:jmetergraphhtml.pl]]
  • [get | view] (2006-11-28 08:20:58, 1.0 KB) [[attachment:jmxparse.sh.txt]]
  • [get | view] (2009-02-17 04:11:21, 1.4 KB) [[attachment:jtlmin.sh.txt]]
  • [get | view] (2009-07-30 18:15:56, 0.9 KB) [[attachment:jtlsummary.sh]]
  • [get | view] (2006-11-28 06:05:53, 2.1 KB) [[attachment:jtltotals.sh.txt]]
  • [get | view] (2011-02-15 21:16:39, 243.2 KB) [[attachment:package.zip]]
  • [get | view] (2009-02-17 05:30:26, 23.4 KB) [[attachment:perf-excel2.png]]
  • [get | view] (2005-06-28 10:09:05, 33.6 KB) [[attachment:scripts_jmeter.zip]]
  • [get | view] (2006-11-28 05:41:12, 4.9 KB) [[attachment:throughput-graph.png]]
  • [get | view] (2006-11-28 07:00:28, 0.8 KB) [[attachment:utime2ymd.txt]]
 All files | Selected Files: delete move to page

You are not allowed to attach a file to this page.