#!/bin/sh
#
# Generate statstics on "metalog" after stripping out Amdahl domain.
#

echo -n "Statistics taken "
date
echo " "

tempf=/tmp/meta$$

echo "#of connections:"
grep -v charon metalog > $tempf
echo -n " 0 (old)      "
grep "svc 0" $tempf | wc | cut -c1-9
echo -n " 1 (new)      "
grep "svc 1" $tempf | wc | cut -c1-9
echo -n " 2 (verbose)  "
grep "svc 2" $tempf | wc | cut -c1-9
echo -n " 3 (info)     "
grep "svc 3" $tempf | wc | cut -c1-9
echo -n " 4 (faq)      "
grep "svc 4" $tempf | wc | cut -c1-9
echo -n " 5 (metarc)   "
grep "svc 5" $tempf | wc | cut -c1-9
echo -n " 6 (RSA keys) "
grep "svc 6" $tempf | wc | cut -c1-9
echo -n " - total      "
grep "Conn" $tempf | wc | cut -c1-9

echo ""
echo -n "#of different sites:"
grep Conn $tempf | cut -c36-120 | cut -d\  -f1 |sort |uniq |wc | cut -c1-9

rm $tempf

