Merge "[Ceilometer] Add context and scenario for resources"
This commit is contained in:
commit
7c9aee7adf
@ -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
|
||||
|
23
samples/tasks/scenarios/ceilometer/get-tenant-resources.json
Normal file
23
samples/tasks/scenarios/ceilometer/get-tenant-resources.json
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
16
samples/tasks/scenarios/ceilometer/get-tenant-resources.yaml
Normal file
16
samples/tasks/scenarios/ceilometer/get-tenant-resources.yaml
Normal 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"
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -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"]
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user