Browse Source

Add omsimulator HA tests

Ilya Shakhat 3 years ago
parent
commit
e41e4212d8

+ 7
- 6
performa/engine/report.py View File

@@ -33,13 +33,16 @@ from performa.engine import utils
33 33
 LOG = logging.getLogger(__name__)
34 34
 
35 35
 
36
-def generate_chart(chart_str, records_collection, doc_folder, tag):
36
+def generate_chart(chart_str, db, doc_folder, tag):
37 37
     chart = yaml.safe_load(chart_str)
38 38
     pipeline = chart.get('pipeline')
39 39
     title = chart.get('title')
40 40
     fill = chart.get('fill') or False
41 41
     axes = chart.get('axes') or dict(x='x', y='y')
42 42
 
43
+    collection_name = chart.get('collection') or 'records'
44
+    collection = db.get_collection(collection_name)
45
+
43 46
     LOG.debug('Title: %s', title)
44 47
 
45 48
     pipeline.insert(0, {'$match': {'status': 'OK'}})
@@ -47,7 +50,7 @@ def generate_chart(chart_str, records_collection, doc_folder, tag):
47 50
     if tag:
48 51
         pipeline.insert(0, {'$match': {'tag': tag}})
49 52
 
50
-    chart_data = records_collection.aggregate(pipeline)
53
+    chart_data = collection.aggregate(pipeline)
51 54
 
52 55
     lines = collections.defaultdict(list)
53 56
 
@@ -66,7 +69,7 @@ def generate_chart(chart_str, records_collection, doc_folder, tag):
66 69
         for k in y_keys:
67 70
             lines[k].append((chart_rec['x'], chart_rec[k]))
68 71
         table += ('   *\n' +
69
-                  '\n'.join('     - %.1f' % chart_rec[v]
72
+                  '\n'.join('     - %.1f' % (chart_rec[v] or 0)
70 73
                             for v in sorted(axes.keys())) +
71 74
                   '\n')
72 75
 
@@ -112,8 +115,6 @@ def generate_report(scenario, base_dir, mongo_url, db_name, doc_folder,
112 115
     mongo_client = pymongo.MongoClient(**connection_params)
113 116
     db = mongo_client.get_database(db_name)
114 117
 
115
-    records_collection = db.get_collection('records')
116
-
117 118
     report_definition = scenario['report']
118 119
     report_template = report_definition['template']
119 120
 
@@ -124,7 +125,7 @@ def generate_report(scenario, base_dir, mongo_url, db_name, doc_folder,
124 125
     jinja_env = jinja2.Environment()
125 126
     jinja_env.filters['chart'] = functools.partial(
126 127
         generate_chart,
127
-        records_collection=records_collection,
128
+        db=db,
128 129
         doc_folder=doc_folder,
129 130
         tag=tag)
130 131
 

+ 47
- 0
performa/scenarios/mq/omsimulator-ha-call.rst View File

@@ -0,0 +1,47 @@
1
+Oslo.messaging simulator HA report
2
+----------------------------------
3
+
4
+This report is result of `message_queue_performance`_ execution
5
+with `Oslo.messaging Simulator`_
6
+
7
+
8
+Test Case 1: RPC CALL Throughput Test
9
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
+
11
+**Messages sent by the client**
12
+
13
+{{'''
14
+    title: RPC CALL sent messages
15
+    axes:
16
+      x: time
17
+      y: sent, msg
18
+    chart: line
19
+    collection: series
20
+    pipeline:
21
+    - { $match: { task: omsimulator, mode: call, name: client_0 }}
22
+    - { $project: { x: "$seq",
23
+                    y: "$count"
24
+                  }}
25
+    - { $sort: { x: 1 }}
26
+''' | chart
27
+}}
28
+
29
+**Replies received by the client**
30
+
31
+{{'''
32
+    title: RPC CALL round-trip messages
33
+    axes:
34
+      x: time
35
+      y: round-trip, msg
36
+      y2: latency, ms
37
+    chart: line
38
+    collection: series
39
+    pipeline:
40
+    - { $match: { task: omsimulator, mode: call, name: round_trip_0 }}
41
+    - { $project: { x: "$seq",
42
+                    y: "$count",
43
+                    y2: { $multiply: ["$latency", 1000] }
44
+                  }}
45
+    - { $sort: { x: 1 }}
46
+''' | chart
47
+}}

+ 44
- 0
performa/scenarios/mq/omsimulator-ha-call.yaml View File

@@ -0,0 +1,44 @@
1
+title: OMSimulator HA test
2
+
3
+description:
4
+  This scenario uses oslo.messaging simulator tool to execute MQ test plan.
5
+
6
+parameters:
7
+  tester_hosts: List of hosts were omsimulator will be executed
8
+  rabbit_url: RabbitMQ address
9
+
10
+setup:
11
+  -
12
+    hosts: {{ tester_hosts }}
13
+    tasks:
14
+    - apt: name=git
15
+      become: yes
16
+    - apt: name=daemon
17
+      become: yes
18
+    - name: installing omsimulator
19
+      git: repo=git://git.openstack.org/openstack/oslo.messaging
20
+           dest=/tmp/performa/oslo.messaging
21
+    - apt: name=python-dev
22
+      become: yes
23
+    - apt: name=python-pip
24
+      become: yes
25
+    - pip: name=virtualenv
26
+      become: yes
27
+    - pip: requirements=/tmp/performa/oslo.messaging/requirements.txt virtualenv=/tmp/performa/oslo.messaging/.venv
28
+    - pip: name=eventlet virtualenv=/tmp/performa/oslo.messaging/.venv
29
+    - command: /tmp/performa/oslo.messaging/.venv/bin/python setup.py install
30
+      args:
31
+        chdir: /tmp/performa/oslo.messaging
32
+
33
+execution:
34
+  -
35
+    hosts: {{ tester_hosts }}
36
+    tasks:
37
+    - omsimulator:
38
+        mode: call
39
+        duration: 100
40
+        threads: 1
41
+        url: {{ rabbit_url }}
42
+
43
+report:
44
+  template: omsimulator-ha-call.rst

+ 47
- 0
performa/scenarios/mq/omsimulator-ha-cast.rst View File

@@ -0,0 +1,47 @@
1
+Oslo.messaging simulator HA report
2
+----------------------------------
3
+
4
+This report is result of `message_queue_performance`_ execution
5
+with `Oslo.messaging Simulator`_
6
+
7
+
8
+Test Case 1: RPC CAST Throughput Test
9
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10
+
11
+**Messages sent by the client**
12
+
13
+{{'''
14
+    title: RPC CAST sent messages
15
+    axes:
16
+      x: time
17
+      y: sent, msg
18
+    chart: line
19
+    collection: series
20
+    pipeline:
21
+    - { $match: { task: omsimulator, mode: cast, name: client_0 }}
22
+    - { $project: { x: "$seq",
23
+                    y: "$count"
24
+                  }}
25
+    - { $sort: { x: 1 }}
26
+''' | chart
27
+}}
28
+
29
+**Messages received by the server**
30
+
31
+{{'''
32
+    title: RPC CAST received messages
33
+    axes:
34
+      x: time
35
+      y: round-trip, msg
36
+      y2: latency, ms
37
+    chart: line
38
+    collection: series
39
+    pipeline:
40
+    - { $match: { task: omsimulator, mode: cast, name: server }}
41
+    - { $project: { x: "$seq",
42
+                    y: "$count",
43
+                    y2: { $multiply: ["$latency", 1000] }
44
+                  }}
45
+    - { $sort: { x: 1 }}
46
+''' | chart
47
+}}

+ 44
- 0
performa/scenarios/mq/omsimulator-ha-cast.yaml View File

@@ -0,0 +1,44 @@
1
+title: OMSimulator HA test
2
+
3
+description:
4
+  This scenario uses oslo.messaging simulator tool to execute MQ test plan.
5
+
6
+parameters:
7
+  tester_hosts: List of hosts were omsimulator will be executed
8
+  rabbit_url: RabbitMQ address
9
+
10
+setup:
11
+  -
12
+    hosts: {{ tester_hosts }}
13
+    tasks:
14
+    - apt: name=git
15
+      become: yes
16
+    - apt: name=daemon
17
+      become: yes
18
+    - name: installing omsimulator
19
+      git: repo=git://git.openstack.org/openstack/oslo.messaging
20
+           dest=/tmp/performa/oslo.messaging
21
+    - apt: name=python-dev
22
+      become: yes
23
+    - apt: name=python-pip
24
+      become: yes
25
+    - pip: name=virtualenv
26
+      become: yes
27
+    - pip: requirements=/tmp/performa/oslo.messaging/requirements.txt virtualenv=/tmp/performa/oslo.messaging/.venv
28
+    - pip: name=eventlet virtualenv=/tmp/performa/oslo.messaging/.venv
29
+    - command: /tmp/performa/oslo.messaging/.venv/bin/python setup.py install
30
+      args:
31
+        chdir: /tmp/performa/oslo.messaging
32
+
33
+execution:
34
+  -
35
+    hosts: {{ tester_hosts }}
36
+    tasks:
37
+    - omsimulator:
38
+        mode: cast
39
+        duration: 100
40
+        threads: 1
41
+        url: {{ rabbit_url }}
42
+
43
+report:
44
+  template: omsimulator-ha-cast.rst

Loading…
Cancel
Save