diff --git a/db/db_bench.cc b/db/db_bench.cc index 3fc17d7b7..8e5d07a59 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -1353,7 +1353,11 @@ class Benchmark { } } if (!FLAGS_use_existing_db) { - DestroyDB(FLAGS_db, Options()); + Options options; + if (!FLAGS_wal_dir.empty()) { + options.wal_dir = FLAGS_wal_dir; + } + DestroyDB(FLAGS_db, options); } } diff --git a/tools/benchmark.sh b/tools/benchmark.sh index 2ea300d32..135209384 100755 --- a/tools/benchmark.sh +++ b/tools/benchmark.sh @@ -93,7 +93,7 @@ function run_bulkload { --num=$num_keys \ --disable_auto_compactions=1 \ --sync=0 \ - --disable_data_sync=1 \ + --disable_data_sync=0 \ --threads=1 2>&1 | tee $output_dir/benchmark_bulkload_fillrandom.log" echo $cmd | tee $output_dir/benchmark_bulkload_fillrandom.log eval $cmd @@ -103,7 +103,7 @@ function run_bulkload { --num=$num_keys \ --disable_auto_compactions=1 \ --sync=0 \ - --disable_data_sync=1 \ + --disable_data_sync=0 \ --threads=1 2>&1 | tee $output_dir/benchmark_bulkload_compact.log" echo $cmd | tee $output_dir/benchmark_bulkload_compact.log eval $cmd @@ -197,7 +197,11 @@ echo "===== Benchmark =====" # Run!!! IFS=',' read -a jobs <<< $1 for job in ${jobs[@]}; do - echo "Start $job at `date`" | tee -a $report + + if [ $job != debug ]; then + echo "Start $job at `date`" | tee -a $report + fi + start=$(now) if [ $job = bulkload ]; then run_bulkload @@ -213,13 +217,19 @@ for job in ${jobs[@]}; do run_readwhilewriting elif [ $job = rangescanwhilewriting ]; then run_rangescanwhilewriting + elif [ $job = debug ]; then + num_keys=10000; # debug + echo "Setting num_keys to $num_keys" else echo "unknown job $job" exit fi end=$(now) - echo "Complete $job in $((end-start)) seconds" | tee -a $report + if [ $job != debug ]; then + echo "Complete $job in $((end-start)) seconds" | tee -a $report + fi + if [[ $job = readrandom || $job = readwhilewriting || $job == rangescanwhilewriting ]]; then lat=$(grep "micros\/op" "$output_dir/benchmark_$job.log" | grep "ops\/sec" | awk '{print $3}') qps=$(grep "micros\/op" "$output_dir/benchmark_$job.log" | grep "ops\/sec" | awk '{print $5}')