Merge "[Ceilometer] Add context and scenario for resources"

This commit is contained in:
Jenkins 2015-05-08 01:47:03 +00:00 committed by Gerrit Code Review
commit 7c9aee7adf
6 changed files with 96 additions and 1 deletions

View File

@ -296,6 +296,26 @@
failure_rate:
max: 0
CeilometerResource.get_tenant_resources:
-
runner:
type: "constant"
times: 10
concurrency: 5
context:
users:
tenants: 2
users_per_tenant: 2
ceilometer:
counter_name: "cpu_util"
counter_type: "gauge"
counter_volume: 1.0
counter_unit: "instance"
resources_per_tenant: 3
sla:
failure_rate:
max: 0
CeilometerSamples.list_samples:
-
runner:
@ -306,6 +326,13 @@
users:
tenants: 1
users_per_tenant: 1
ceilometer:
counter_name: "cpu_util"
counter_type: "gauge"
counter_unit: "instance"
counter_volume: 1.0
resources_per_tenant: 3
samples_per_resource: 3
sla:
failure_rate:
max: 0

View File

@ -0,0 +1,23 @@
{
"CeilometerResource.get_tenant_resources": [
{
"runner": {
"type": "constant",
"times": 10,
"concurrency": 5
},
"context": {
"users": {
"tenants": 2,
"users_per_tenant": 2
},
"ceilometer": {
"counter_name": "cpu_util",
"counter_type": "gauge",
"counter_unit": "instance",
"counter_volume": 1.0
}
}
}
]
}

View File

@ -0,0 +1,16 @@
---
CeilometerResource.get_tenant_resources:
-
runner:
type: "constant"
times: 10
concurrency: 5
context:
users:
tenants: 2
users_per_tenant: 2
ceilometer:
counter_name: "cpu_util"
counter_type: "gauge"
counter_volume: 1.0
counter_unit: "instance"

View File

@ -10,6 +10,14 @@
"users": {
"tenants": 2,
"users_per_tenant": 2
},
"ceilometer": {
"counter_name": "cpu_util",
"counter_type": "gauge",
"counter_unit": "instance",
"counter_volume": 1.0,
"resources_per_tenant": 3,
"samples_per_resource": 3
}
}
}

View File

@ -9,3 +9,10 @@
users:
tenants: 2
users_per_tenant: 2
ceilometer:
counter_name: "cpu_util"
counter_type: "gauge"
counter_unit: "instance"
counter_volume: 1.0
resources_per_tenant: 3
samples_per_resource: 3

View File

@ -224,6 +224,7 @@ class FakeAlarm(FakeResource):
self.threshold = kwargs.get("threshold")
self.state = kwargs.get("state", "fake-alarm-state")
self.alarm_id = kwargs.get("alarm_id", "fake-alarm-id")
self.state = kwargs.get("state", "ok")
self.optional_args = kwargs.get("optional_args", {})
@ -234,7 +235,17 @@ class FakeSample(FakeResource):
self.counter_type = kwargs.get("counter_type", "fake-counter-type")
self.counter_unit = kwargs.get("counter_unit", "fake-counter-unit")
self.counter_volume = kwargs.get("counter_volume", 100)
self.resource_id = kwargs.get("resource_id", "fake-resource-id")
@property
def resource_id(self):
return "fake-resource-id"
def to_dict(self):
return {"counter_name": self.counter_name,
"counter_type": self.counter_type,
"counter_unit": self.counter_unit,
"counter_volume": self.counter_volume,
"resource_id": self.resource_id}
class FakeVolume(FakeResource):
@ -780,6 +791,9 @@ class FakeMeterManager(FakeManager):
class FakeCeilometerResourceManager(FakeManager):
def get(self, resource_id):
return ["fake-resource-info"]
def list(self):
return ["fake-resource"]