#!/bin/bash

# Canonical workload on the canonical setup


if [ $DATABASE == "rethinkdb" ]; then
    ./dbench                                                                                      \
        -d "$BENCH_DIR/bench_output/Canonical_workload_on_canonical_hardware" -H $SERVER_HOSTS    \
        {server}rethinkdb:"--active-data-extents 1 -m 32768 $SSD_DRIVES --unsaved-data-limit 32768"                                            \
        {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/Canonical_workload_on_canonical_hardware" -H $SERVER_HOSTS             \
        {server}mysql:"$MYSQL_COMMON_FLAGS $MYSQL_BUFFER_FLAGS $MYSQL_DURABILITY_FLAGS $MYSQL_SSD_FLAGS"              \
        {client}mysqlstress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION" \
        iostat:1 vmstat:1
elif [ $DATABASE == "membase" ]; then
    ./dbench                                                                                   \
        -d "$BENCH_DIR/bench_output/Canonical_workload_on_canonical_hardware" -H $SERVER_HOSTS -p 11211 \
        {server}membase:"-d $MEMBASE_DATA_PATH -m 32768"                                       \
        {client}stress[$STRESS_CLIENT]:"-c $CANONICAL_CLIENTS -d $CANONICAL_DURATION" \
        iostat:1 vmstat:1
else
    echo "No workload configuration for $DATABASE"
fi

