Root/ircstat/stat

Source at commit 1b9eddfe72f86d904c8513e77e9eb14137d103ee created 11 years 11 months ago.
By Werner Almesberger, ircstat/: end of March 2012 update (and new script to plot mailing lists)
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=3
7t=
8>_out
9n=0
10off=2
11for y in 10 11 12; do
12    for m in 1 2 3 4 5 6 7 8 9 10 11 12; do
13        mm=`printf "%02d" $m`
14        [ "`echo ${Q}_20${y}-${mm}-*`" = "${Q}_20${y}-${mm}-*" ] &&
15          [ "`echo ${M}_20${y}-${mm}-*`" = "${M}_20${y}-${mm}-*" ] &&
16            continue
17        if [ `expr $n % $N` = 0 ]; then
18            [ "$t" ] && t=$t,
19            t="$t \"$m/$y\" $n"
20        else
21            t="$t, \"\" $n"
22        fi
23# cat ${Q}_20${y}-${mm}-*.log.html | gzip -9 | wc -c >>_out
24        qn=`sed 's/<[^>]*>/ /g' ${Q}_20${y}-${mm}-*.log.html |
25            gzip -9 | wc -c`
26        mn=`sed 's/<[^>]*>/ /g' ${M}_20${y}-${mm}-*.log.html |
27            gzip -9 | wc -c`
28        echo $qn $mn >>_out
29        n=`expr $n + 1`
30    done
31done
32
33gnuplot -persist <<EOF
34set xtics ($t)
35set grid xtics
36set title "Traffic on the Qi-Hardware IRC channels"
37set xlabel "Month"
38set ylabel "Traffic (kbytes gzip'ed)"
39plot "<sed '\$d' _out" using (\$1/1000) with lines title "#qi-hardware" lw 2, \
40  "<sed '\$d' _out" using (\$2/1000) with lines title "#milkymist" lw 2, \
41  "<sed '\$d' _out" using :((\$1+\$2)/1000) with lines title "Both" lw 2
42set term png
43set output "out.png"
44replot
45EOF
46

Archive Download this file

Branches:
master



interactive