#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#        http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.
#

#
#    Contains all benchmarks for (with async backups):
#    - ATOMIC operations
#    - TRANSACTIONAL operations
#    - SQL queries
#
#    Benchmarks can be run with the following command (after running `mvn clean package`):
#       bin/benchmark-run-all.sh config/benchmark.properties
#

# JVM options.
JVM_OPTS=${JVM_OPTS}" -DIGNITE_QUIET=false"

# Uncomment to enable concurrent garbage collection (GC) if you encounter long GC pauses.
JVM_OPTS=${JVM_OPTS}" \
  -Xms6g \
  -Xmx6g \
  -XX:+UseParNewGC \
  -XX:+UseConcMarkSweepGC \
"

# List of default probes.
# Add DStatProbe or VmStatProbe if your OS supports it (e.g. if running on Linux).
BENCHMARK_DEFAULT_PROBES=ThroughputLatencyProbe,PercentileProbe,DStatProbe

# Packages where the specified benchmark is searched by reflection mechanism.
BENCHMARK_PACKAGES=org.yardstickframework,org.apache.ignite.yardstick

# Deploy binaries to remote nodes.
#AUTO_COPY=true
AUTO_COPY=false

# Restart server after each benchmark.
RESTART_SERVERS=true

# Probe point writer class name.
# BENCHMARK_WRITER=

# Comma-separated list of the hosts to run BenchmarkServers on. 2 nodes on local host are enabled by default.
SERVER_HOSTS=dserver2,dserver3,dserver4,dserver5

# Comma-separated list of the hosts to run BenchmarkDrivers on. 1 node on local host is enabled by default.
DRIVER_HOSTS=dserver1

# Remote username.
# REMOTE_USER=

# Number of nodes, used to wait for the specified number of nodes to start.
nodesNum=$((`echo ${SERVER_HOSTS} | tr ',' '\n' | wc -l` + `echo ${DRIVER_HOSTS} | tr ',' '\n' | wc -l`))

# Ignite version.
ver="ignite-1.9-"

# Backups count.
b=1

# Warmup.
w=60

# Duration.
d=300

# Threads count.
t=64

# Run configuration which contains all benchmarks.
# Note that each benchmark is set to run for 300 seconds (5 mins) with warm-up set to 60 seconds (1 minute).
CONFIGS="\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgnitePutBenchmark -sn IgniteNode -ds ${ver}atomic-put-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgnitePutGetBenchmark -sn IgniteNode -ds ${ver}atomic-put-get-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgnitePutGetBatchBenchmark -bs 6 -sn IgniteNode -ds ${ver}atomic-put-get-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgnitePutTxImplicitBenchmark -sn IgniteNode -ds ${ver}tx-optimistic-put-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -txc OPTIMISTIC  --client -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-optim-repRead-put-get-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -txc PESSIMISTIC  --client -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-pessim-repRead-put-get-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -txc OPTIMISTIC -txi SERIALIZABLE  --client -dn IgnitePutGetTxBenchmark -sn IgniteNode -ds ${ver}tx-opt-serial-put-get-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgniteSqlQueryBenchmark -sn IgniteNode -ds ${ver}sql-query-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC  --client -dn IgniteSqlQueryPutBenchmark -sn IgniteNode -ds ${ver}sql-query-put-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6  --client -dn IgnitePutAllBenchmark -sn IgniteNode -ds ${ver}atomic-putAll-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6  --client -dn IgnitePutAllTxBenchmark -sn IgniteNode -ds ${ver}tx-putAll-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6  --client -dn IgnitePutAllSerializableTxBenchmark -sn IgniteNode -ds ${ver}tx-putAllSerializable-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6 -txc OPTIMISTIC   --client -dn IgniteGetAllPutAllTxBenchmark -sn IgniteNode -ds ${ver}tx-optimistic-getAllPutAll-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6 -txc PESSIMISTIC  --client -dn IgniteGetAllPutAllTxBenchmark -sn IgniteNode -ds ${ver}tx-pessimistic-getAllPutAll-bs-6-${b}-backup,\
-cfg ${SCRIPT_DIR}/../config/ignite-localhost-config.xml -nn ${nodesNum} -b ${b} -w ${w} -d ${d} -t ${t} -sm PRIMARY_SYNC -bs 6 -txc OPTIMISTIC -txi SERIALIZABLE  --client -dn IgniteGetAllPutAllTxBenchmark -sn IgniteNode -ds ${ver}tx-opt-serializable-getAllPutAll-bs-6-${b}-backup,\
"
