head	1.1;
access;
symbols;
locks
	dfk:1.1; strict;
comment	@# @;


1.1
date	96.07.04.02.59.41;	author dfk;	state Exp;
branches;
next	;


desc
@@


1.1
log
@Initial revision
@
text
@#!/bin/csh -f
#
# sum-metric - extract the sum of an array metric from a sim file
#
set usage='usage: sum-metric parameter-name foo.sim[.gz]'
#
# Part of
#              The STARFISH Parallel file-system simulator
#        (Simulation Tool for Advanced Research in File Systems)
# 
#                               David Kotz
#                           Dartmouth College
#                              Version 2.0
#                              January 1995
#                          dfk@@cs.dartmouth.edu

if ($#argv != 2) then
	echo "$usage"
	exit 1
endif

set tmp=/tmp/summ$$
onintr cleanup

set stat="$1"
statgraph -s -m"$stat:q" -f $2 \
   |& sed '1,/^Array Metric/d' \
   | awk '{sum += $NF} END {print sum}'

cleanup:
rm -f $tmp
@
