basic_consolidation trivial fix

This fix adds usage of granularity parameter.
Should be merged ASAP.

Change-Id: I469ee056b32f95aba02100450c65945ee9877b23
This commit is contained in:
Alexander Chadin 2018-03-06 15:43:56 +03:00
parent 9af32bce5b
commit cce5ebd3f0
2 changed files with 8 additions and 3 deletions

View File

@ -2,7 +2,12 @@
check:
jobs:
- watcher-tempest-multinode
- legacy-rally-dsvm-watcher-rally
- legacy-rally-dsvm-watcher-rally-non-vote
- job:
name: legacy-rally-dsvm-watcher-rally-non-vote
parent: legacy-rally-dsvm-watcher-rally
voting: false
- job:
name: watcher-tempest-base-multinode

View File

@ -258,11 +258,11 @@ class BasicConsolidation(base.ServerConsolidationBaseStrategy):
def get_node_cpu_usage(self, node):
resource_id = "%s_%s" % (node.uuid, node.hostname)
return self.datasource_backend.get_host_cpu_usage(
resource_id, self.period, 'mean', granularity=300)
resource_id, self.period, 'mean', granularity=self.granularity)
def get_instance_cpu_usage(self, instance):
return self.datasource_backend.get_instance_cpu_usage(
instance.uuid, self.period, 'mean', granularity=300)
instance.uuid, self.period, 'mean', granularity=self.granularity)
def calculate_score_node(self, node):
"""Calculate the score that represent the utilization level