#!/bin/bash

# HDD I/O bound performance

if [ $DATABASE == "rethinkdb" ]; then
    ./dbench                                                                 \
        -d "$BENCH_DIR/bench_output/HDD_IO_performance_(canonical_workload)" -H $SERVER_HOSTS     \
        {server}rethinkdb:"--active-data-extents 1 -m 512 $HDD_DRIVES"                          \
        {client}stress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"          \
        iostat:1 vmstat:1 rdbstat:1
elif [ $DATABASE == "mysql" ]; then
    ./dbench                                                                 \
        -d "$BENCH_DIR/bench_output/HDD_IO_performance_(canonical_workload)" -H $SERVER_HOSTS     \
        {server}mysql:"$MYSQL_HDD_COMMON_FLAGS $MYSQL_HDD_FLAGS --innodb_buffer_pool_size=512m $MYSQL_DURABILITY_FLAGS"  \
        {client}mysqlstress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION"     \
        iostat:1 vmstat:1
else
    echo "No workload configuration for $DATABASE"
fi
