Browse Source

Fix for aggregate metrics

Change-Id: Ib4b94620b561586b76ef47c78d11548b0334a193
changes/71/446971/2
Olivier Bourdon 2 years ago
parent
commit
63e141c7fb
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py

+ 3
- 3
deployment_scripts/puppet/modules/lma_collector/files/collectd/hypervisor_stats.py View File

@@ -57,7 +57,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
for agg in aggregates_list:
nova_aggregates[agg['name']] = {
'id': agg['id'],
'hosts': agg['hosts'],
'hosts': [h.split('.')[0] for h in agg['hosts']],
'metrics': {'free_vcpus': 0},
}
nova_aggregates[agg['name']]['metrics'].update(
@@ -85,7 +85,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
total_stats[v] += m_val
for agg in nova_aggregates.keys():
agg_hosts = nova_aggregates[agg]['hosts']
if stats['hypervisor_hostname'] in agg_hosts:
if host in agg_hosts:
nova_aggregates[agg]['metrics'][v] += m_val
if 'cpu_ratio' in self.extra_config:
m_vcpus = stats.get('vcpus', 0)
@@ -100,7 +100,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
total_stats['free_vcpus'] += free
for agg in nova_aggregates.keys():
agg_hosts = nova_aggregates[agg]['hosts']
if stats['hypervisor_hostname'] in agg_hosts:
if host in agg_hosts:
free = ((int(self.extra_config['cpu_ratio'] *
m_vcpus)) -
m_vcpus_used)

Loading…
Cancel
Save