diff options
author | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-04-13 17:03:16 +0100 |
---|---|---|
committer | Patrick J Cherry <patrick@bytemark.co.uk> | 2011-04-13 17:03:16 +0100 |
commit | 89a67770e66d11740948e90a41db6cee0482cf8e (patch) | |
tree | be858515fb789a89d68f94975690ab019813726c /utils/buffer_size.sh |
new version.
Diffstat (limited to 'utils/buffer_size.sh')
-rwxr-xr-x | utils/buffer_size.sh | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/utils/buffer_size.sh b/utils/buffer_size.sh new file mode 100755 index 0000000..02984b2 --- /dev/null +++ b/utils/buffer_size.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +NO_ARGS=0 +OPTERROR=65 +if [ $# -eq "$NO_ARGS" ] # Script invoked with no command-line args? +then + echo "Usage: `basename $0` File.log" + exit $OPTERROR # Exit and explain usage, if no argument(s) given. +fi +logFile=$1 + +egrep 'Buffer has [0-9]* packets left' $logFile |\ + awk 'BEGIN {print " date sz"} {print s++ " " $1 "::" $2 " " $10}' > data + +R --vanilla --no-save --slave <<RSCRIPT +lst <- read.table("data") +attach(lst) +summary(sz) +png(filename="buffer.png", width=1024) +dates <- strptime(as.character(date), "%Y-%m-%d::%H:%M:%S") +plot(dates, sz, type='l', + main="Mauve server: Maximum buffer size per second", + xlab="Time", + ylab="Maximum number of packets waiting to be processed") +abline(h=1.05, col="red") +abline(h=mean(sz), col="blue") +RSCRIPT +img=`which qiv` +if [ $? != 0 ] +then echo "Cannot display image here" +else $img buffer.png +fi |