3 # Copyright (c) 2002-2003 Silicon Graphics, Inc. All Rights Reserved.
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License as
7 # published by the Free Software Foundation.
9 # This program is distributed in the hope that it would be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
14 # You should have received a copy of the GNU General Public License
15 # along with this program; if not, write the Free Software Foundation,
16 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 # Does a bonnie throughput run (80M file and 1K chunksize if the
20 # BONNIE_FILESIZE and/or BONNIE_CHUNKSIZE variables are not set),
21 # then massages the output into CSV format with the human-readable
22 # output preceding it as a "comment" (ie. #-prefixed).
24 BONNIE_FILESIZE=${BONNIE_FILESIZE:=500M}
25 BONNIE_CHUNKSIZE=${BONNIE_CHUNKSIZE:=1K}
27 [ -z "$here" ] && here=`pwd`
31 # Sample bonnie throughput output (stderr):
32 #Version 1.02c ------Sequential Output------ --Sequential Input- --Random-
33 # -Per Chr- --Block-- -Rewrite- -Per Chr- --Block-- --Seeks--
34 #Machine Size:chnk K/sec %CP K/sec %CP K/sec %CP K/sec %CP K/sec %CP /sec %CP
35 # 150M:64k 52024 99 88969 99 245492 100 3746 264
39 sed -e 's/^..................../# /g' | awk '{print} END {print "#"}'
43 # Sample bonnie throughput output (stdout):
44 # ",150M:64k,,,52024,99,88969,99,,,245492,100,3746.0,264,,,,,,,,,,,,,"
50 s/,+/,/g; s/^,//; s/,$//;
52 printf "%9s", shift @values;
53 for ($i = 0; $i <= $#values; $i++) {
54 if ($i % 2) { printf ",%4s%%", $values[$i] }
55 else { printf ",%10s", $values[$i] }
62 printf "%9s,%10s,%5s,%10s,%5s,%10s,%5s,%10s,%5s\n" size:chnk \
63 writeK/s wCPU rewriteK/s rwCPU readK/s rCPU seek/s sCPU
66 run_bonnie -n 0 -s $BONNIE_FILESIZE:$BONNIE_CHUNKSIZE