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
#
# metrics - print summary of the array metrics in a sim file
#
set usage='usage: metrics configs/.../results/....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 != 1) then
    echo "$usage"
    exit 1
endif

# PLAIN METRICS
set metrics=(\
    '.total. Total execution time' \
    '.tthruput. Total thruput in KBps' \
    '.IOPread. read time, avg MSEC' \
    '.IOPread_sd. read time, stddev MSEC' \
    '.IOPwrite. write time, avg MSEC' \
    '.IOPwrite_sd. write time, stddev MSEC' \
    '.EmptyBlock. time, avg TICS' \
    '.FillBlock. time, avg TICS')

set i=0
while ($i < $#metrics)	      # really, foreach metric ($metrics:q) 
    @@ i ++;
    statgraph -m -f $1 |& grep ^"$metrics[$i]"
end

# ARRAY METRICS
set metrics=(\
      '[ithruput] Inner thruput in KBps, per CP' \
      '[othruput] Outer thruput in KBps, per CP' \
      '[miss] Cache misses, per proc' \
      '[hit] Cache hits, per proc' \
      '[diskmiss] Disk cache misses, per disk' \
      '[diskhit] Disk cache hits, per disk' \
      '[diskread] Disk reads, per disk' \
      '[diskwrite] Disk writes, per disk' \
      '[diskidle] Disk idle time, per disk' \
      '[diskwait] Disk wait time, avg' \
      '[diskwait_sd] Disk wait time, std dev' \
      '[diskmoves] Disk movements, per disk' \
      '[diskdistance] Disk move distance, per disk')

set i=0
while ($i < $#metrics)	      # really, foreach metric ($metrics:q) 
    @@ i ++;
    set metric="$metrics[$i]"    
    echo -n "${metric}: "
    statgraph -m"$metric" -f $1 |& sed '1,/^Array Metric/d' \
    	| awk 'NF==2 {print $2}' | stats sum mean
end

@
