Rename and unify MQ / RabbitMQ scenarios

Change-Id: If6d2fedc54cb0b3686d9eb51a2bafe836bb0189e
This commit is contained in:
Ilya Shakhat 2016-03-28 16:56:06 +03:00
parent fbc1679790
commit 0176a979bc
13 changed files with 13 additions and 163 deletions

View File

@ -58,8 +58,9 @@ optional arguments:
User for connecting to remote systems, defaults to
env[PERFORMA_REMOTE_USER].
--scenario SCENARIO Scenario to play. Can be a file name or one of
aliases: "db/sysbench", "mq/omsimulator". Defaults to
env[PERFORMA_SCENARIO].
aliases: "db/sysbench", "mq/rabbitmq-ha-call", "mq
/rabbitmq-ha-cast", "mq/rabbitmq-ha-notify",
"mq/rabbitmq". Defaults to env[PERFORMA_SCENARIO].
--syslog-log-facility SYSLOG_LOG_FACILITY
Syslog facility to receive log lines. This option is
ignored if log_config_append is set.

View File

@ -57,8 +57,9 @@ optional arguments:
User for connecting to remote systems, defaults to
env[PERFORMA_REMOTE_USER].
--scenario SCENARIO Scenario to play. Can be a file name or one of
aliases: "db/sysbench", "mq/omsimulator". Defaults to
env[PERFORMA_SCENARIO].
aliases: "db/sysbench", "mq/rabbitmq-ha-call", "mq
/rabbitmq-ha-cast", "mq/rabbitmq-ha-notify",
"mq/rabbitmq". Defaults to env[PERFORMA_SCENARIO].
--syslog-log-facility SYSLOG_LOG_FACILITY
Syslog facility to receive log lines. This option is
ignored if log_config_append is set.

View File

@ -99,8 +99,9 @@
# From performa.engine.config
#
# Scenario to play. Can be a file name or one of aliases: "db/sysbench",
# "mq/omsimulator". Defaults to env[PERFORMA_SCENARIO]. (string value)
# Scenario to play. Can be a file name or one of aliases: "db/sysbench", "mq
# /rabbitmq-ha-call", "mq/rabbitmq-ha-cast", "mq/rabbitmq-ha-notify",
# "mq/rabbitmq". Defaults to env[PERFORMA_SCENARIO]. (string value)
#scenario = <None>
# Mongo URL, defaults to env[PERFORMA_MONGO_URL]. (string value)

View File

@ -1,122 +0,0 @@
title: OMSimulator
description:
This scenario uses oslo.messaging simulator tool to execute MQ test plan.
parameters:
tester_hosts: List of hosts were omsimulator will be executed
rabbit_hosts: List of hosts were RabbitMQ runs
rabbit_url: RabbitMQ address
client_url: Override RabbitMQ address for the client
server_url: Override RabbitMQ address for the server
setup:
-
hosts: {{ tester_hosts }}
tasks:
- apt: name=git
become: yes
- apt: name=daemon
become: yes
- name: installing omsimulator
git: repo=git://git.openstack.org/openstack/oslo.messaging
dest=/tmp/performa/oslo.messaging
- apt: name=python-dev
become: yes
- apt: name=python-pip
become: yes
- pip: name=virtualenv
become: yes
- pip: requirements=/tmp/performa/oslo.messaging/requirements.txt virtualenv=/tmp/performa/oslo.messaging/.venv
- pip: name=eventlet virtualenv=/tmp/performa/oslo.messaging/.venv
- command: /tmp/performa/oslo.messaging/.venv/bin/python setup.py install
args:
chdir: /tmp/performa/oslo.messaging
-
hosts: {{ rabbit_hosts }}
tasks:
- apt: name=atop
become: yes
- apt: name=daemon
become: yes
execution:
-
hosts: {{ rabbit_hosts }}
tasks:
- atop: command=start
-
hosts: {{ tester_hosts }}
matrix:
threads: [ 1, 2, 5, 10, 20, 50 ]
tasks:
- omsimulator:
mode: call
duration: 100
url: {{ rabbit_url }}
client_url: {{ client_url }}
server_url: {{ server_url }}
-
hosts: {{ tester_hosts }}
matrix:
threads: [ 1, 2, 5, 10, 20, 50 ]
tasks:
- omsimulator:
mode: cast
duration: 100
url: {{ rabbit_url }}
client_url: {{ client_url }}
server_url: {{ server_url }}
-
hosts: {{ tester_hosts }}
matrix:
threads: [ 1, 2, 5, 10, 20, 50 ]
tasks:
- omsimulator:
mode: notify
duration: 100
url: {{ rabbit_url }}
client_url: {{ client_url }}
server_url: {{ server_url }}
-
hosts: {{ rabbit_hosts }}
tasks:
- atop:
command: stop
labels: [ PRC ]
aggregation:
-
update:
query:
{ task: omsimulator }
values:
pipeline:
- $match: { task: atop, status: OK, label: PRC, name: { $regex: beam.* }, host: {{ rabbit_hosts[0] }} }
- $group: { _id: null, rabbit_sys_0: { $avg: "$sys" }, rabbit_user_0: { $avg: "$user" }, rabbit_total_0: { $avg: { $add: [ "$sys", "$user" ] }} }
{% if rabbit_hosts[1] %}
-
update:
query:
{ task: omsimulator }
values:
pipeline:
- $match: { task: atop, status: OK, label: PRC, name: { $regex: beam.* }, host: {{ rabbit_hosts[1] }} }
- $group: { _id: null, rabbit_sys_1: { $avg: "$sys" }, rabbit_user_1: { $avg: "$user" }, rabbit_total_1: { $avg: { $add: [ "$sys", "$user" ] }} }
{% endif %}
{% if rabbit_hosts[2] %}
-
update:
query:
{ task: omsimulator }
values:
pipeline:
- $match: { task: atop, status: OK, label: PRC, name: { $regex: beam.* }, host: {{ rabbit_hosts[2] }} }
- $group: { _id: null, rabbit_sys_2: { $avg: "$sys" }, rabbit_user_2: { $avg: "$user" }, rabbit_total_2: { $avg: { $add: [ "$sys", "$user" ] }} }
{% endif %}
report:
template: omsimulator.rst

View File

@ -46,4 +46,4 @@ execution:
server_url: {{ server_url }}
report:
template: omsimulator-ha-call.rst
template: rabbitmq-ha-call.rst

View File

@ -46,4 +46,4 @@ execution:
server_url: {{ server_url }}
report:
template: omsimulator-ha-cast.rst
template: rabbitmq-ha-cast.rst

View File

@ -46,4 +46,4 @@ execution:
server_url: {{ server_url }}
report:
template: omsimulator-ha-notify.rst
template: rabbitmq-ha-notify.rst

View File

@ -122,4 +122,4 @@ aggregation:
{% endif %}
report:
template: omsimulator.rst
template: rabbitmq.rst

View File

@ -1,31 +0,0 @@
# Copyright (c) 2016 OpenStack Foundation
#
# 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.
import testtools
from performa.modules import omsimulator
def _read_sample():
with open('performa/tests/omsimulator_sample.txt') as f:
return f.read()
class TestOMSimulator(testtools.TestCase):
def test_parse_client_call(self):
expected = dict(msg_sent=5313, bytes_sent=14897652, duration=10,
msg_sent_bandwidth=531, bytes_sent_bandwidth=1489765)
self.assertEqual(expected, omsimulator.parse_output(_read_sample()))