performa/performa/scenarios/db/sysbench.yaml

62 lines
1.5 KiB
YAML

title: Sysbench DB
description:
This scenario uses sysbench to execute DB test plan.
parameters:
tester_hosts: List of hosts were omsimulator will be executed
mysql_hosts: List of hosts were MySQL runs
mysql_endpoint: Address of MySQL endpoint
mysql_port: MySQL port number
setup:
-
hosts: {{ tester_hosts }}
tasks:
- name: installing sysbench
apt: name=sysbench
become: yes
-
hosts: {{ mysql_hosts }}
tasks:
- apt: name=atop
become: yes
- apt: name=daemon
become: yes
execution:
-
hosts: {{ mysql_hosts }}
tasks:
- atop: command=start
-
hosts: {{ tester_hosts }}
matrix:
threads: [ 5, 10, 15, 20, 30, 40, 50 ]
tasks:
- sysbench_oltp:
duration: 60
mysql_host: {{ mysql_endpoint }}
mysql_port: {{ mysql_port }}
mysql_db: sbtest
-
hosts: {{ mysql_hosts }}
tasks:
- atop:
command: stop
labels: [ PRC ]
aggregation:
-
update:
query:
{ task: sysbench_oltp }
values:
pipeline:
- { $match: { task: atop, status: OK, label: PRC, name: mysqld }}
- { $group: { _id: "$host", mysqld_sys: { $avg: "$sys" }, mysqld_user: { $avg: "$user" }, mysqld_total: { $avg: { $add: [ "$sys", "$user" ] }} }}
- { $group: { _id: null, mysqld_sys: { $sum: "$mysqld_sys"}, mysqld_user: { $sum: "$mysqld_user" }, mysqld_total: { $sum: "$mysqld_total" }}}
report:
template: sysbench.rst