Werner's Miscellanea
Sign in or create your account | Project List | Help
Werner's Miscellanea Commit Details
Date: | 2011-08-08 22:27:53 (12 years 7 months ago) |
---|---|
Author: | Werner Almesberger |
Commit: | db8c6d52d1fd00360c62bfbe1434cc49f42f580d |
Message: | ircstat/: IRC traffic analysis |
Files: |
ircstat/collect (1 diff) ircstat/stat (1 diff) |
Change Details
ircstat/collect | ||
---|---|---|
1 | #!/bin/sh | |
2 | wget --mirror --no-parent -nv http://en.qi-hardware.com/irclogs/ | |
3 | wget --mirror --no-parent -nv http://en.qi-hardware.com/mmlogs/ | |
4 |
ircstat/stat | ||
---|---|---|
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 "_out" using (\$1/1000) with lines title "#qi-hardware" lw 2, \ | |
39 | "_out" using (\$2/1000) with lines title "#milkymist" lw 2, \ | |
40 | "_out" using :((\$1+\$2)/1000) with lines title "Both" | |
41 | set term png | |
42 | set output "out.png" | |
43 | replot | |
44 | EOF |
Branches:
master