#!/bin/bash . ${0%_compare}_functions WIDTH=640 HEIGHT=480 EXCLUDE="" get_filesystem_list() { typeset dir=$1 if [ "$EXCLUDE" = "" ] then ls -1 $DIR else ls -1 $DIR | grep -v $EXCLUDE fi } cat_files() { for fs in $FS do cat ${DIR}/$fs done } gen_file() { typeset field=$1 cat_files | extract_fields $field } getbase() { typeset file=$1 awk 'BEGIN { base=-1 } { if (base == -1) base=$2; if ($2 < base) base = $2 } END { print base}' $file } gen_gnuplot() { typeset -i count=0 field=$1 base=$2 BOXWIDTH=0.80 case $field in transactions) TITLE="Transactions" YLABEL="operations per seconds" ;; requests) TITLE="read/write requests" YLABEL="operations per seconds" ;; other) TITLE="Other operations" YLABEL="operations per seconds" ;; time) TITLE="Total time" YLABEL="Time in seconds" ;; event) TITLE="Total time taken by event execution" YLABEL="Time in seconds" ;; min|avg|max) TITLE="Per-request statistics ($field)" YLABEL="Time in seconds" ;; esac for fs in $FS do echo "set label \"$fs\" at first $count+0.5,$base left rotate by 90 front" let count=$count+1 done cat <" exit 1 fi FIELDS="transactions requests other time event min avg max" FS=$(get_filesystem_list $DIR) rm -fr ./gnuplot mkdir gnuplot for field in $FIELDS do gen_file $field > gnuplot/$field done cd gnuplot for field in $FIELDS do base=$(getbase $field) echo "Generating ${field}.png" gen_gnuplot $field $base | gnuplot done