blob: d78a916b64c560f2a9ec6b3618ee79810e932d8b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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 'Packet processed in [\.0-9]* seconds' $logFile |\
awk 'BEGIN {print " date sz"} {print s++ " " $1 "::" $2 " " $11}' > data
R --vanilla --no-save --slave <<RSCRIPT
lst <- read.table("data")
attach(lst)
summary(sz)
png(filename="packets.png", width=1024)
dates <- strptime(as.character(date), "%Y-%m-%d::%H:%M:%S")
plot(dates, sz, type='l',
main="Mauve server: maximum processing time of a packet per second.",
xlab="Time",
ylab="Maximum processing time of one packet")
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 packets.png
fi
|