Root/ircstat/mlstat

Source at commit 57b53c61c1b37a913fc963c3c0bec0364efbcb7e created 10 years 1 month ago.
By Werner Almesberger, ircstat/ML: update for 2014-01
1#!/bin/sh
2list=
3while read l; do
4    case "$l" in
5    *qi-hardware*)
6        list=q;;
7    *serverraum*)
8        list=m;;
9    20*) set -- `echo "$l" | sed "s/ / -/g"`
10        y=$1
11        for m in 1 2 3 4 5 6 7 8 9 10 11 12; do
12            shift
13            [ "$1" ] || break
14            if [ "$1" = - ]; then
15                v=
16            else
17                v=$1
18            fi
19            eval ${list}_${y}_${m}=$v
20        done
21    esac
22done <ML
23
24N=4
25t=
26>_out
27n=0
28off=2
29for y in 10 11 12 13 14; do
30    for m in 1 2 3 4 5 6 7 8 9 10 11 12; do
31        mm=`printf "%02d" $m`
32        qn=`eval echo \\$q_20${y}_${m}`
33        mn=`eval echo \\$m_20${y}_${m}`
34        [ -z "$qn" -a -z "$mn" ] && continue
35        if [ `expr $n % $N` = 0 ]; then
36            [ "$t" ] && t=$t,
37            t="$t \"$m/$y\" $n"
38        else
39            t="$t, \"\" $n"
40        fi
41# cat ${Q}_20${y}-${mm}-*.log.html | gzip -9 | wc -c >>_out
42        echo ${qn:-0} ${mn:-0} >>_out
43        n=`expr $n + 1`
44    done
45done
46
47gnuplot -persist <<EOF
48set xtics ($t)
49set grid xtics
50set title "Traffic on the Qi-Hardware Mailing Lists"
51set xlabel "Month"
52set ylabel "Traffic (kbytes gzip'ed)"
53plot "_out" using (\$1) with lines title "qi-hardware" lw 2, \
54  "_out" using (\$2) with lines title "milkymist" lw 2, \
55  "_out" using :(\$1+\$2) with lines title "Both" lw 2
56set term png
57set output "out.png"
58replot
59EOF
60

Archive Download this file

Branches:
master



interactive