#!/bin/sh
#
# Copyright 2003, Juan Segarra Flor
#
# This is part of videocache
#
# Videocache is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# Videocache is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Foobar; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
#

for fi in `ls -1 *.trc`
do
  awk 'BEGIN{d=0;bw=0}{d+=$1;bw+=$1*$2}END{print d,bw/d}' $fi
done | awk 'BEGIN{md=0;mbw=0;n=0}{md=(md*n+$1)/(n+1);mbw=(mbw*n+$2)/(n+1);n++}END{print "duracio mitja:",md,"min - Bw mig:",mbw*24*8/1000,"kbps"}'
