Date:2011-08-08 22:27:53 (7 years 10 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
2wget --mirror --no-parent -nv http://en.qi-hardware.com/irclogs/
3wget --mirror --no-parent -nv http://en.qi-hardware.com/mmlogs/
4
ircstat/stat
1#!/bin/sh
2Q=en.qi-hardware.com/irclogs/qi-hardware
3M=en.qi-hardware.com/mmlogs/milkymist
4# Saving to: `en.qi-hardware.com/irclogs/qi-hardware_2010-06-11.log.html'
5
6N=2
7t=
8>_out
9n=0
10for 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
30done
31
32gnuplot -persist <<EOF
33set xtics ($t)
34set grid xtics
35set title "Traffic on the Qi-Hardware IRC channels"
36set xlabel "Month"
37set ylabel "Traffic (kbytes gzip'ed)"
38plot "_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"
41set term png
42set output "out.png"
43replot
44EOF

Archive Download the corresponding diff file

Branches:
master



interactive