summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Bourdon <obourdon@mirantis.com>2017-03-17 13:00:08 +0100
committerOlivier Bourdon <obourdon@mirantis.com>2017-03-17 13:29:11 +0100
commit63e141c7fb607b7449b4685f4af469a9bedbb31a (patch)
tree74f7ddec8773308a0f6ea8726de67bccd245c079
parentab344cbc522de3b7eb9267531cc8978e9f76db0c (diff)
Fix for aggregate metrics
Notes
Notes (review): Code-Review+2: Swann Croiset <scroiset@mirantis.com> Code-Review+2: Olivier Bourdon <obourdon@mirantis.com> Workflow+1: Olivier Bourdon <obourdon@mirantis.com> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Mon, 20 Mar 2017 07:27:19 +0000 Reviewed-on: https://review.openstack.org/446971 Project: openstack/fuel-plugin-lma-collector Branch: refs/heads/master
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py
index 3e8b8fa..b4f32db 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py
+++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py
@@ -57,7 +57,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
57 for agg in aggregates_list: 57 for agg in aggregates_list:
58 nova_aggregates[agg['name']] = { 58 nova_aggregates[agg['name']] = {
59 'id': agg['id'], 59 'id': agg['id'],
60 'hosts': agg['hosts'], 60 'hosts': [h.split('.')[0] for h in agg['hosts']],
61 'metrics': {'free_vcpus': 0}, 61 'metrics': {'free_vcpus': 0},
62 } 62 }
63 nova_aggregates[agg['name']]['metrics'].update( 63 nova_aggregates[agg['name']]['metrics'].update(
@@ -85,7 +85,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
85 total_stats[v] += m_val 85 total_stats[v] += m_val
86 for agg in nova_aggregates.keys(): 86 for agg in nova_aggregates.keys():
87 agg_hosts = nova_aggregates[agg]['hosts'] 87 agg_hosts = nova_aggregates[agg]['hosts']
88 if stats['hypervisor_hostname'] in agg_hosts: 88 if host in agg_hosts:
89 nova_aggregates[agg]['metrics'][v] += m_val 89 nova_aggregates[agg]['metrics'][v] += m_val
90 if 'cpu_ratio' in self.extra_config: 90 if 'cpu_ratio' in self.extra_config:
91 m_vcpus = stats.get('vcpus', 0) 91 m_vcpus = stats.get('vcpus', 0)
@@ -100,7 +100,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
100 total_stats['free_vcpus'] += free 100 total_stats['free_vcpus'] += free
101 for agg in nova_aggregates.keys(): 101 for agg in nova_aggregates.keys():
102 agg_hosts = nova_aggregates[agg]['hosts'] 102 agg_hosts = nova_aggregates[agg]['hosts']
103 if stats['hypervisor_hostname'] in agg_hosts: 103 if host in agg_hosts:
104 free = ((int(self.extra_config['cpu_ratio'] * 104 free = ((int(self.extra_config['cpu_ratio'] *
105 m_vcpus)) - 105 m_vcpus)) -
106 m_vcpus_used) 106 m_vcpus_used)