kdlucas / byte-unixbench

Automatically exported from code.google.com/p/byte-unixbench
GNU General Public License v2.0
1.27k stars 323 forks source link

Added change directories and filename via Environment variables. #53

Closed t2-kob closed 6 years ago

t2-kob commented 6 years ago

I deleted Branch by mistake, so I will make a pull request again. Sorry!


UnixBench was trying support to change directories via Environment variables, I think. But could not use it because the code was not correctly. Therefore, I enable it. And, also added support to change filename.

This change does not affect the benchmark score.


usage:

1. Change output directory

export UB_RESULTDIR=/tmp/benchmark_result/
./Run

2. Change benchmarking directory of file based benchmark (named as "fs****")

export UB_TMPDIR=/tmp/working_directory/
./Run

3. Change output file name

export UB_OUTPUT_FILE_NAME=test_benchmark_result
./Run

With all three options, result is below.

[root@Palladium v5.1.3_environment_changes]# ./Run -i 1 -c 1 fstime

# (something make log skiped)

   #    #  #    #  #  #    #          #####   ######  #    #   ####   #    #
   #    #  ##   #  #   #  #           #    #  #       ##   #  #    #  #    #
   #    #  # #  #  #    ##            #####   #####   # #  #  #       ######
   #    #  #  # #  #    ##            #    #  #       #  # #  #       #    #
   #    #  #   ##  #   #  #           #    #  #       #   ##  #    #  #    #
    ####   #    #  #  #    #          #####   ######  #    #   ####   #    #

   Version 5.1.3                      Based on the Byte Magazine Unix Benchmark

   Multi-CPU version                  Version 5 revisions by Ian Smith,
                                      Sunnyvale, CA, USA
   January 13, 2011                   johantheghost at yahoo period com

------------------------------------------------------------------------------
   Use directories for:
      * File I/O tests (named fs***) = /tmp/working_directory/
      * Results                      = /tmp/benchmark_result/
------------------------------------------------------------------------------

# test results...

On benchmarking:

[root@Palladium results]# ls -al /tmp/working_directory/
合計 12
drwxr-xr-x  2 root root 4096  1月 12 13:08 2018 .
drwxrwxrwt. 7 root root 4096  1月 12 13:06 2018 ..
-rw-------  1 root root    0  1月 12 13:08 2018 dummy0
-rw-------  1 root root    0  1月 12 13:08 2018 dummy1
-rwxr-xr-x  1 root root   14  1月 12 13:08 2018 kill_run

Result:

[root@Palladium results]# ls -al /tmp/benchmark_result/
合計 20
drwxr-xr-x  2 root root 4096  1月 12 13:06 2018 .
drwxrwxrwt. 7 root root 4096  1月 12 13:06 2018 ..
-rw-r--r--  1 root root 1037  1月 12 13:09 2018 test_benchmark_result
-rw-r--r--  1 root root 3258  1月 12 13:09 2018 test_benchmark_result.html
-rw-r--r--  1 root root 1286  1月 12 13:09 2018 test_benchmark_result.log
t2-kob commented 6 years ago

Fixed the "USAGE". Please check it. Thanks.