Add Mistral benchmark

- added Mistral client initialization
- added Mistral scenarios
- added unit tests

Change-Id: Ie60a36504a970e6acb369adc570a556e549c20e1
This commit is contained in:
Anastasia Kuznetsova 2014-12-29 19:10:31 +04:00
parent a0a7a7a93d
commit 2348fd1b4a
10 changed files with 188 additions and 1 deletions

View File

@ -0,0 +1,13 @@
---
version: "2.0"
name: wb
workflows:
wf1:
type: direct
tasks:
hello:
action: std.echo output="Hello"
publish:
result: $

View File

@ -0,0 +1,46 @@
---
MistralWorkbooks.list_workbooks:
-
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
MistralWorkbooks.create_workbook:
-
args:
definition: "/home/jenkins/.rally/extra/mistral_wb.yaml"
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0
-
args:
definition: "/home/jenkins/.rally/extra/mistral_wb.yaml"
do_delete: true
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1
sla:
failure_rate:
max: 0

View File

@ -108,6 +108,7 @@ class _Service(utils.ImmutableMixin, utils.EnumMixin):
TROVE = "trove"
SAHARA = "sahara"
SWIFT = "swift"
MISTRAL = "mistral"
class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
@ -130,6 +131,7 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
DATABASE = "database"
DATA_PROCESSING = "data_processing"
OBJECT_STORE = "object-store"
WORKFLOW_EXECUTION = "workflowv2"
def __init__(self):
self.__names = {
@ -149,7 +151,8 @@ class _ServiceType(utils.ImmutableMixin, utils.EnumMixin):
self.S3: _Service.S3,
self.DATABASE: _Service.TROVE,
self.DATA_PROCESSING: _Service.SAHARA,
self.OBJECT_STORE: _Service.SWIFT
self.OBJECT_STORE: _Service.SWIFT,
self.WORKFLOW_EXECUTION: _Service.MISTRAL,
}
def __getitem__(self, service_type):

View File

@ -0,0 +1,21 @@
{
"MistralWorkbooks.create_workbook": [
{
"args": {
"definition": "rally-jobs/extra/mistral_wb.yaml",
"do_delete": true
},
"runner": {
"type": "constant",
"times": 50,
"concurrency": 10
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]
}

View File

@ -0,0 +1,15 @@
---
MistralWorkbooks.create_workbook:
-
args:
definition: rally-jobs/extra/mistral_wb.yaml
do_delete: true
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -0,0 +1,20 @@
{
"MistralWorkbooks.create_workbook": [
{
"args": {
"definition": "rally-jobs/extra/mistral_wb.yaml"
},
"runner": {
"type": "constant",
"times": 50,
"concurrency": 10
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]
}

View File

@ -0,0 +1,14 @@
---
MistralWorkbooks.create_workbook:
-
args:
definition: rally-jobs/extra/mistral_wb.yaml
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -0,0 +1,17 @@
{
"MistralWorkbooks.list_workbooks": [
{
"runner": {
"type": "constant",
"times": 50,
"concurrency": 10
},
"context": {
"users": {
"tenants": 1,
"users_per_tenant": 1
}
}
}
]
}

View File

@ -0,0 +1,11 @@
---
MistralWorkbooks.list_workbooks:
-
runner:
type: "constant"
times: 50
concurrency: 10
context:
users:
tenants: 1
users_per_tenant: 1

View File

@ -279,6 +279,12 @@ class FakeAvailabilityZone(FakeResource):
self.hosts = mock.MagicMock()
class FakeWorkbook(FakeResource):
def __init__(self, manager=None):
super(FakeWorkbook, self).__init__(manager)
self.workbook = mock.MagicMock()
class FakeManager(object):
def __init__(self):
@ -806,6 +812,15 @@ class FakeAvailabilityZonesManager(FakeManager):
return [self.zones]
class FakeWorkbookManager(FakeManager):
def __init__(self):
super(FakeWorkbookManager, self).__init__()
self.workbook = FakeWorkbook()
def list(self):
return [self.workbook]
class FakeServiceCatalog(object):
def get_endpoints(self):
return {"image": [{"publicURL": "http://fake.to"}],
@ -1188,6 +1203,12 @@ class FakeTroveClient(object):
self.instances = FakeDbInstanceManager()
class FakeMistralClient(object):
def __init__(self):
self.workbook = FakeWorkbookManager()
class FakeClients(object):
def __init__(self, endpoint_=None):
@ -1202,6 +1223,7 @@ class FakeClients(object):
self._ceilometer = None
self._zaqar = None
self._trove = None
self._mistral = None
self._endpoint = endpoint_ or objects.Endpoint(
"http://fake.example.org:5000/v2.0/",
"fake_username",
@ -1266,6 +1288,11 @@ class FakeClients(object):
self._trove = FakeTroveClient()
return self._trove
def mistral(self):
if not self._mistral:
self._mistral = FakeMistralClient()
return self._mistral
class FakeRunner(object):