### SysBench is a suite of benchmarks that includes a simple OLTP benchmark.
### In this configuration it is running executing read-only "complex"
### transaction types as defined by the suite itself. The transaction types
### are described in the sysbench manual. The underlying database used is
### mariadb 10.0.12 and is scaled to be 75% of RAM. The page cache is not
### flushed after the database is populated so the test starts cache-hot.

# MM Test Parameters
export MMTESTS="sysbench"

# Test disk to setup (optional)
#export TESTDISK_RAID_DEVICES=
#export TESTDISK_RAID_MD_DEVICE=/dev/md0
#export TESTDISK_RAID_OFFSET=63
#export TESTDISK_RAID_SIZE=250019532
#export TESTDISK_RAID_TYPE=raid0
#export TESTDISK_PARTITION=/dev/sda6
#export TESTDISK_FILESYSTEM=ext3
#export TESTDISK_MKFS_PARAM="-f -d agcount=8"
#export TESTDISK_MOUNT_ARGS=""

# List of monitors
export RUN_MONITOR=yes
export MONITORS_ALWAYS=
export MONITORS_GZIP="proc-vmstat top iotop"
export MONITORS_WITH_LATENCY="vmstat iostat"
export MONITOR_PERF_EVENTS=cpu-migrations,context-switches
export MONITOR_UPDATE_FREQUENCY=10

# sysbench
export OLTP_CACHESIZE=$(($MEMTOTAL_BYTES/2))
export OLTP_SHAREDBUFFERS=$((MEMTOTAL_BYTES/4))
export OLTP_PAGESIZES="default"
export SYSBENCH_DRIVER=mariadb
export SYSBENCH_MAX_TRANSACTIONS=auto
export SYSBENCH_READONLY=yes
export SYSBENCH_MAX_THREADS=$((NUMCPUS))
export SYSBENCH_ITERATIONS=3
export SYSBENCH_WORKLOAD_SIZE=$((MEMTOTAL_BYTES*3/4))
export SYSBENCH_CACHE_COLD=yes
export DATABASE_INIT_ONCE=yes
if [ $SYSBENCH_MAX_THREADS -gt 172 ]; then
        SYSBENCH_MAX_THREADS=141
fi
