gift=${1-`pidof giftd`}
interval=30 # seconds
time=0
host=127.0.0.1
port=`perl -lne '/http_port.*?=\s*(.*)/ and print $1' ~/.giFT/OpenFT/OpenFT.conf`
while :; do
wget $host:$port/nodes -q -O nodes.tmp
conns=`wc -l <nodes.tmp`
children=`perl -lnae 'map {$_&256 and print } $F[3]' nodes.tmp|wc -l`
snodes=`perl -lnae 'map {$_&2 and print } $F[3]' nodes.tmp|wc -l`
time=$((time + 1))
fds=`ls /proc/$gift/fd/|wc -l`
date=`date +%s`
printf "%-5d %-5d %-5d %-5d %-5d %-10d\n" $time $conns $children $snodes $fds $date
rm nodes.tmp
sleep $interval
done
