Fix for aggregate metrics
Change-Id: Ib4b94620b561586b76ef47c78d11548b0334a193
This commit is contained in:
parent
ab344cbc52
commit
63e141c7fb
|
@ -57,7 +57,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
|
||||||
for agg in aggregates_list:
|
for agg in aggregates_list:
|
||||||
nova_aggregates[agg['name']] = {
|
nova_aggregates[agg['name']] = {
|
||||||
'id': agg['id'],
|
'id': agg['id'],
|
||||||
'hosts': agg['hosts'],
|
'hosts': [h.split('.')[0] for h in agg['hosts']],
|
||||||
'metrics': {'free_vcpus': 0},
|
'metrics': {'free_vcpus': 0},
|
||||||
}
|
}
|
||||||
nova_aggregates[agg['name']]['metrics'].update(
|
nova_aggregates[agg['name']]['metrics'].update(
|
||||||
|
@ -85,7 +85,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
|
||||||
total_stats[v] += m_val
|
total_stats[v] += m_val
|
||||||
for agg in nova_aggregates.keys():
|
for agg in nova_aggregates.keys():
|
||||||
agg_hosts = nova_aggregates[agg]['hosts']
|
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
|
nova_aggregates[agg]['metrics'][v] += m_val
|
||||||
if 'cpu_ratio' in self.extra_config:
|
if 'cpu_ratio' in self.extra_config:
|
||||||
m_vcpus = stats.get('vcpus', 0)
|
m_vcpus = stats.get('vcpus', 0)
|
||||||
|
@ -100,7 +100,7 @@ class HypervisorStatsPlugin(openstack.CollectdPlugin):
|
||||||
total_stats['free_vcpus'] += free
|
total_stats['free_vcpus'] += free
|
||||||
for agg in nova_aggregates.keys():
|
for agg in nova_aggregates.keys():
|
||||||
agg_hosts = nova_aggregates[agg]['hosts']
|
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'] *
|
free = ((int(self.extra_config['cpu_ratio'] *
|
||||||
m_vcpus)) -
|
m_vcpus)) -
|
||||||
m_vcpus_used)
|
m_vcpus_used)
|
||||||
|
|
Loading…
Reference in New Issue