Attachment 'jtltotals.sh.txt'

Download

   1 #!/bin/sh
   2 LINECOUNT=linecount.jtot
   3 UNIXTIMEA=utimea.jtot
   4 UNIXTIMEZ=utimez.jtot
   5 DATETIMEA=ymda.jtot
   6 DATETIMEZ=ymdz.jtot
   7 ELAPSEDSEC=elapsedsec.jtot
   8 ELAPSEDHMS=elapsedhms.jtot
   9 RESPONSEAV=response.jtot
  10 OUTFILE=jtl-file-totals.txt
  11 
  12 echo "Gathering data .."
  13 
  14 echo -n "$LINECOUNT"
  15 wc -l */*/*jtl | awk '{print $2 "\t" $1}' > $LINECOUNT
  16 if [ ! -s $LINECOUNT ] ; then echo "file empty!" ; exit 1 ; fi
  17 
  18 echo -n " $UNIXTIMEA"
  19 for fl in `ls */*/*jtl`; do sed -n '2 p' $fl|cut -c -10; done > $UNIXTIMEA
  20 
  21 echo -n " $UNIXTIMEZ"
  22 for fl in `ls */*/*jtl`; do tail -1 $fl|cut -c -10; done > $UNIXTIMEZ 
  23 
  24 echo -n " $DATETIMEA"
  25 for ut in `cat $UNIXTIMEA`; do utime2ymd $ut; done > $DATETIMEA 
  26 
  27 echo -n " $DATETIMEZ"
  28 for ut in `cat $UNIXTIMEZ`; do utime2ymd $ut; done > $DATETIMEZ
  29 
  30 echo -n " $ELAPSEDSEC"
  31 [ -f $ELAPSEDSEC ] && { rm $ELAPSEDSEC ; }
  32 flcount=`wc -l $DATETIMEA|awk '{print $1}'`
  33 line=1
  34 while [ $line -le $flcount ]
  35 do  
  36     begin=`sed -n "$line p" $UNIXTIMEA`
  37     end=`sed -n "$line p" $UNIXTIMEZ`
  38     elapsed=`echo "$end - $begin" | bc -l`
  39     echo "$elapsed" >> $ELAPSEDSEC
  40     line=$(($line+1))
  41 done
  42 
  43 echo -n " $ELAPSEDHMS"
  44 for sectot in `cat $ELAPSEDSEC`
  45 do 
  46     blob=`utime2ymd $sectot gmt`
  47     hh=`echo $blob|cut -c10,11`
  48     mm=`echo $blob|cut -c12,13`
  49     ss=`echo $blob|cut -c14,15`
  50     echo "$hh:$mm:$ss"
  51 done > $ELAPSEDHMS
  52 
  53 echo -n " $RESPONSEAV"
  54 [ -f $RESPONSEAV ] && { rm $RESPONSEAV ; }
  55 for fl in `ls */*/*jtl`
  56 do    
  57     FLWORKING=/tmp/jtlsum.$$
  58     sed -n '2,$ p' $fl > $FLWORKING
  59     sum=`awk -F',' '{ print "a = a + " $2 "; a" }' $FLWORKING | bc -l | tail -1`
  60     n=`wc -l $FLWORKING|awk '{print $1}'`
  61     avg=`echo "$sum / $n" | bc -l | awk '{printf "%0.2f",$1}'`
  62     echo $avg >> $RESPONSEAV
  63     rm $FLWORKING
  64 done
  65 
  66 echo -e "\n\nWriting output file .."
  67 echo -e "JMeter-Output-file,total-throughput,start,end,elapsed-sec,elapsed-hms,response-av" \
  68     > $OUTFILE
  69 paste -d ',' $LINECOUNT $DATETIMEA $DATETIMEZ $ELAPSEDSEC $ELAPSEDHMS $RESPONSEAV \
  70     | tr "\t" "," >> $OUTFILE
  71 rm *jtot 
  72 
  73 echo $OUTFILE
  74 echo "done."

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.