diff options
| author | Martin Ritchie <ritchiem@apache.org> | 2010-04-12 15:42:21 +0000 |
|---|---|---|
| committer | Martin Ritchie <ritchiem@apache.org> | 2010-04-12 15:42:21 +0000 |
| commit | 9da586a72784508e3b7c04e19639cb3907fa1ab5 (patch) | |
| tree | ef30b644aea06be63fe6f9db66fbcbc427d315ab /qpid/java/perftests/bin/processing/process.sh | |
| parent | cee13443091a714e837429beab62a2c09e0911d9 (diff) | |
| download | qpid-python-9da586a72784508e3b7c04e19639cb3907fa1ab5.tar.gz | |
QPID-2424 : Augment processing scripts to generate min/max/avg stats file for CPU/MEM, GC-Freq,GC-Duration, Heap-Size.
Merged from 0.5.x-dev rev 917452
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@933282 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/perftests/bin/processing/process.sh')
| -rwxr-xr-x | qpid/java/perftests/bin/processing/process.sh | 84 |
1 files changed, 82 insertions, 2 deletions
diff --git a/qpid/java/perftests/bin/processing/process.sh b/qpid/java/perftests/bin/processing/process.sh index cb2181622c..f8e13cd5cd 100755 --- a/qpid/java/perftests/bin/processing/process.sh +++ b/qpid/java/perftests/bin/processing/process.sh @@ -51,7 +51,11 @@ processCMSGCFile() cat parnew.gc.log | awk '{print $8}' | cut -d 'K' -f 2 | cut -d '>' -f 2 > HEAP_POST_GC.log cat parnew.gc.log | awk '{print $1}' | cut -d ':' -f 1 > GC_TIME.log - + calculateStats "MEM_PRE" HEAP_PRE_GC.log + calculateStats "MEM_POST" HEAP_POST_GC.log + calcualteStatsBC "GC_FREQ" GC_FREQ.log + + # Calculate ParNew GC Cumulative total cat parnew.gc.log |awk '{sum=sum+$6; print $6, sum}' > GC_DUR.log # Give a count of GC occurances @@ -129,6 +133,82 @@ processG1GCFile() } +calculateStatsBC() +{ +label=$1 +file=$2 +# Calculate GC Frequencies + prevFreq=0 + countFreq=0 + gcFreqTotal=0 + minFreq=99999999 + maxFreq=0 + + echo "" > GC_FREQ.log + for time in `cat $file` ; do + if [ $prevFreq == 0 ] ; then + prevFreq=$time + else + freq=`echo $time - $prevFreq | bc` + echo $freq >> GC_FREQ.log + + prevFreq=$time + gcFreqTotal=`echo $gcFreqTotal + $freq | bc` + countFreq=$[$countFreq + 1] + + if [ `echo "$freq > $maxFreq " | bc` == 1 ] ; then + maxFreq=$freq + fi + + if [ `echo "$freq < $minFreq " | bc ` == 1 ] ; then + minFreq=$freq + fi + fi + done + + # Extract Min/Max/Avg + echo "#type:min/max/avg" > $file.stats + avgFreq=`echo $gcFreqTotal / $countFreq | bc -l` + echo "$1:$minFreq/$maxFreq/$avgFreq" >> $file.stats +} + +calculateStats() +{ +label=$1 +file=$2 + +# Calculate GC Frequencies + count=0 + gcTotal=0 + min=0 + max=0 + + + for item in `cat $file` ; do + if [ $min == 0 ] ; then + min=$item + fi + + gcTotal=$[$gcTotal + $item] + count=$[$count + 1] + + if [ $item -gt $max ] ; then + max=$item + fi + + if [ $item -lt $min ] ; then + min=$item + fi + done + + # Extract Min/Max/Avg + echo "#type:min/max/avg" > $file.stats + avg=`echo $gcTotal / $count | bc -l` + + echo "$label:$min/$max/$avg" >> $file.stats + echo "Done Stat generation for $file" +} + # # Take an input file ($1) of lines # <value><K|M> @@ -282,4 +362,4 @@ set format x "%H:%M" plot "CPU.data" using 1:2 with lines EOGNUPLOT -popd &> /dev/null +popd &> /dev/null
\ No newline at end of file |
