222beea621c8adffddd3a9798afe13193206a409
[swift-upb.git] / mfold / loggraphs
1 #!/bin/bash
2
3 if [ -z "$SERVERS" ]; then
4     SERVERS="servers.txt"
5 fi
6
7 cd harvest
8
9 for from in `grep -v '^#' ../$SERVERS`; do
10     for to in `grep -v '^#' ../$SERVERS`; do
11         CWNDLOG="$from-$to-cwnd.log"
12         if [ ! -e $CWNDLOG ]; then
13             continue
14         fi
15         GP="$from-$to.gnuplot"
16         echo "set term png large size 1024,768" > $GP
17         PNG="$from-$to.png"
18         if [ -e $PNG ]; then rm $PNG; fi
19         echo "set out '$from-$to.png'" >> $GP
20         echo "set y2tics" >> $GP
21         echo "set y2label 'packets'" >> $GP
22         echo "set ylabel 'microseconds'" >> $GP
23         echo "set xlabel 'run time millis'" >> $GP
24         CWNDLOG="$from-$to-cwnd.log"
25         echo -ne "plot '$CWNDLOG' using 1:2 with lines title 'cwnd'"\
26                 " axis x1y2, "\
27                 " '$CWNDLOG' using 1:3 with lines title 'data out'"\
28                 " axis x1y2 "\
29                 >> $GP
30         RTTLOG="$from-$to-rtt.log"
31         if [ -e $RTTLOG ]; then
32             echo -ne ", '$RTTLOG' using 1:2 with lines title 'rtt' "\
33                 "axis x1y1, "\
34                 "'$RTTLOG' using 1:3 with lines title 'dev' "\
35                 "axis x1y1"\
36                 >> $GP
37         fi
38         OWDLOG="$from-$to-owd.log"
39         if [ -e $OWDLOG ]; then
40             echo -ne ", '$OWDLOG' using 1:2 with lines title 'owd' "\
41                 "axis x1y1, "\
42                 "'$OWDLOG' using 1:3 with lines title 'min owd'"\
43                 "axis x1y1, "\
44                 "'$OWDLOG' using 1:($2+25000) with lines title 'target'"\
45                 "axis x1y1 "\
46                 >> $GP
47         fi
48         echo >> $GP
49         ( cat $GP | gnuplot ) &
50     done
51 done
52
53 wait
54 cd ..