"Fossies" - the Fresh Open Source Software Archive

Member "fou4s-0.16.0/fou4s-benchmark" (8 Feb 2005, 2325 Bytes) of package /linux/privat/old/fou4s-0.16.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/bash
    2 ###################################################
    3 # fou4s-bench - Test several SuSE FTP Servers for speed
    4 #
    5 # Copyright (C) 2002 Guenther Sommer <gue@rettung.at>
    6 #
    7 # This program is free software; you can redistribute it and/or
    8 # modify it under the terms of the GNU General Public License
    9 # as published by the Free Software Foundation; either version 2
   10 # of the License, or (at your option) any later version. 
   11 #
   12 # This program is distributed in the hope that it will be useful,
   13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
   14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   15 # GNU General Public License for more details. 
   16 #
   17 # You should have received a copy of the GNU General Public License
   18 # along with this program; if not, write to the Free Software
   19 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
   20 #
   21 QUIET=0
   22 if [ "$1" = "-q" ] ; then
   23     QUIET=1
   24 fi
   25 
   26 SUSEVERSION=`cat /etc/SuSE-release | grep ^VERSION`
   27 SUSEVERSION=${SUSEVERSION##VERSION = }
   28 SUSEVERSION=${SUSEVERSION%%-SERVER} # for SLE/Email Server II
   29 ARCH=`cat /etc/SuSE-release | grep ^SuSE | tr 'A-Z' 'a-z'`
   30 ARCH=${ARCH##suse linux*\(}
   31 ARCH=${ARCH%%\)}
   32 SERVERPATH=$ARCH/update/$SUSEVERSION/
   33 if [ "$SUSEVERSION" = "" ]; then
   34          echo "Cannot determine SuSE-version from /etc/SuSE-release"
   35          echo "exiting..."
   36          exit 2
   37 fi
   38 
   39 if [ ! -f /etc/suseservers ] ; then
   40     echo "The file /etc/suseservers was not found. Please run fou4s --server -w to get it"
   41     exit 1
   42 fi
   43 
   44 if [ $QUIET -eq 0 ] ; then
   45     echo "Note, that only servers from /etc/suseservers will be checked. The server(s) configured in fou4s.conf are not checked right now. If you would like to get this feature, please send me a fixed version of fou4s-benchmark, thanks." | fmt
   46     echo Detected SuSE $SUSEVERSION
   47     echo
   48     echo "Starting benchmark. This can take a while, please be patient..."
   49 fi
   50 
   51 function startwget()
   52 {
   53     wget --output-document=/dev/null -q $server/$SERVERPATH
   54     if [ $? -ne 0 ] ; then
   55         continue
   56     fi
   57 }
   58 
   59 #for server in `( cat /etc/suseservers | grep -v "^#"; awk -F = '/^Server=/ {print $2}' </etc/fou4s.conf ) | sort | uniq`; do
   60 #fixme use above?!
   61 for server in `cat /etc/suseservers |grep -v "^#"`; do
   62    echo `(time -p startwget) 2>&1 \
   63    >/dev/null| grep real | sed 's/real//g'` "   " $server
   64 done | sort -n