Refactored the compute model and its elements
In this changeset, I refactored the whole Watcher codebase to adopt a naming convention about the various elements of the Compute model so that it reflects the same naming convention adopted by Nova. Change-Id: I28adba5e1f27175f025330417b072686134d5f51 Partially-Implements: blueprint cluster-model-objects-wrapper
This commit is contained in:
@@ -118,11 +118,11 @@ class ReleasedComputeNodesCount(IndicatorSpecification):
|
||||
voluptuous.Range(min=0), required=True)
|
||||
|
||||
|
||||
class VmMigrationsCount(IndicatorSpecification):
|
||||
class InstanceMigrationsCount(IndicatorSpecification):
|
||||
def __init__(self):
|
||||
super(VmMigrationsCount, self).__init__(
|
||||
name="vm_migrations_count",
|
||||
description=_("The number of migrations to be performed."),
|
||||
super(InstanceMigrationsCount, self).__init__(
|
||||
name="instance_migrations_count",
|
||||
description=_("The number of VM migrations to be performed."),
|
||||
unit=None,
|
||||
)
|
||||
|
||||
|
||||
@@ -34,14 +34,14 @@ class ServerConsolidation(base.EfficacySpecification):
|
||||
def get_indicators_specifications(self):
|
||||
return [
|
||||
indicators.ReleasedComputeNodesCount(),
|
||||
indicators.VmMigrationsCount(),
|
||||
indicators.InstanceMigrationsCount(),
|
||||
]
|
||||
|
||||
def get_global_efficacy_indicator(self, indicators_map):
|
||||
value = 0
|
||||
if indicators_map.vm_migrations_count > 0:
|
||||
if indicators_map.instance_migrations_count > 0:
|
||||
value = (float(indicators_map.released_compute_nodes_count) /
|
||||
float(indicators_map.vm_migrations_count)) * 100
|
||||
float(indicators_map.instance_migrations_count)) * 100
|
||||
|
||||
return efficacy.Indicator(
|
||||
name="released_nodes_ratio",
|
||||
|
||||
Reference in New Issue
Block a user