Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Git Source Tree
Root/
Source at commit 43221017c1c23b29f2a167da0b7e36a797c30bc7 created 12 years 4 months ago. By Werner Almesberger, ircstat/stat: draw also the sum with a thick line | |
---|---|
1 | #!/bin/sh |
2 | Q=en.qi-hardware.com/irclogs/qi-hardware |
3 | M=en.qi-hardware.com/mmlogs/milkymist |
4 | # Saving to: `en.qi-hardware.com/irclogs/qi-hardware_2010-06-11.log.html' |
5 | |
6 | N=2 |
7 | t= |
8 | >_out |
9 | n=0 |
10 | for y in 10 11; do |
11 | for m in 1 2 3 4 5 6 7 8 9 10 11 12; do |
12 | mm=`printf "%02d" $m` |
13 | [ "`echo ${Q}_20${y}-${mm}-*`" = "${Q}_20${y}-${mm}-*" ] && |
14 | [ "`echo ${M}_20${y}-${mm}-*`" = "${M}_20${y}-${mm}-*" ] && |
15 | continue |
16 | if [ `expr $n % $N` = 0 ]; then |
17 | [ "$t" ] && t=$t, |
18 | t="$t \"$m/$y\" $n" |
19 | else |
20 | t="$t, \"\" $n" |
21 | fi |
22 | # cat ${Q}_20${y}-${mm}-*.log.html | gzip -9 | wc -c >>_out |
23 | qn=`sed 's/<[^>]*>/ /g' ${Q}_20${y}-${mm}-*.log.html | |
24 | gzip -9 | wc -c` |
25 | mn=`sed 's/<[^>]*>/ /g' ${M}_20${y}-${mm}-*.log.html | |
26 | gzip -9 | wc -c` |
27 | echo $qn $mn >>_out |
28 | n=`expr $n + 1` |
29 | done |
30 | done |
31 | |
32 | gnuplot -persist <<EOF |
33 | set xtics ($t) |
34 | set grid xtics |
35 | set title "Traffic on the Qi-Hardware IRC channels" |
36 | set xlabel "Month" |
37 | set ylabel "Traffic (kbytes gzip'ed)" |
38 | plot "<sed '\$d' _out" using (\$1/1000) with lines title "#qi-hardware" lw 2, \ |
39 | "<sed '\$d' _out" using (\$2/1000) with lines title "#milkymist" lw 2, \ |
40 | "<sed '\$d' _out" using :((\$1+\$2)/1000) with lines title "Both" lw 2 |
41 | set term png |
42 | set output "out.png" |
43 | replot |
44 | EOF |
45 |
Branches:
master