Added efficacy indicators to /action_plans

I this changeset, I added the efficacy indicators both at the DB
and at the API level alongside the associated logic.

Partially Implements: blueprint efficacy-indicator

Change-Id: I824553637621da67966103c1b0c01348b09bd836
This commit is contained in:
Vincent Françoise
2016-05-20 16:16:33 +02:00
parent 2b95a4cbc4
commit 442512cd71
23 changed files with 380 additions and 103 deletions

View File

@@ -332,7 +332,7 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
:param model: model_root object
:return: {'cpu': <0,1>, 'ram': <0,1>, 'disk': <0,1>}
"""
hypervisors = self.model.get_all_hypervisors().values()
hypervisors = model.get_all_hypervisors().values()
rcu = {}
counters = {}
for hypervisor in hypervisors:
@@ -517,7 +517,7 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
:param original_model: root_model object
"""
LOG.info(_LI('Executing Smart Strategy'))
model = self.get_prediction_model(self.model)
model = self.get_prediction_model()
rcu = self.get_relative_cluster_utilization(model)
self.ceilometer_vm_data_cache = dict()
@@ -546,9 +546,9 @@ class VMWorkloadConsolidation(base.ServerConsolidationBaseStrategy):
LOG.debug(info)
self.solution.model = model
self.solution.efficacy = rcu_after['cpu']
def post_execute(self):
# TODO(v-francoise): Add the indicators to the solution
pass
# self.solution.efficacy = rcu_after['cpu']
self.solution.set_efficacy_indicators(
released_compute_nodes_count=self.number_of_migrations,
vm_migrations_count=self.number_of_released_hypervisors,
)