"Fossies" - the Fresh Open Source Software Archive

Member "glusterfs-8.2/extras/benchmarking/local-script.sh" (16 Sep 2020, 653 Bytes) of package /linux/misc/glusterfs-8.2.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. Alternatively you can here view or download the uninterpreted source code file.

    1 #!/bin/sh
    2 
    3 # This script needs to be present on glusterfs mount, (ie, on every node which wants to run benchmark)
    4 
    5 ifilename="/dev/zero"
    6 ofilename="testdir/testfile.$(hostname)"
    7 result="output/output.$(hostname)"
    8 blocksize=128k
    9 count=8
   10 
   11 mkdir -p testdir;
   12 mkdir -p output;
   13 echo > ${result}
   14 while [ ! -e start-test ]; do
   15     sleep 1;
   16 done;
   17 
   18 
   19 for i in $(seq 1 5); do 
   20     # write
   21     dd if=${ifilename} of=${ofilename} bs=${blocksize} count=${count} 2>&1 | tail -n 1 | cut -f 8,9 -d ' ' >> ${result} ;
   22     # read
   23     #dd if=${ofilename} of=/dev/null bs=${blocksize} count=${count} 2>&1 | tail -n 1 | cut -f 8,9 -d ' ' >> ${result} ;
   24 done
   25 
   26 rm -f start-test