Merge "Fix label name in reported label stats"
This commit is contained in:
commit
9ae18f602e
@ -110,12 +110,15 @@ class StatsReporter(object):
|
||||
states[key] += 1
|
||||
|
||||
# nodepool.label.LABEL.nodes.STATE
|
||||
key = 'nodepool.label.%s.nodes.%s' % (node.type, node.state)
|
||||
# It's possible we could see node types that aren't in our config
|
||||
if key in states:
|
||||
states[key] += 1
|
||||
else:
|
||||
states[key] = 1
|
||||
# nodes can have several labels
|
||||
for label in node.type:
|
||||
key = 'nodepool.label.%s.nodes.%s' % (label, node.state)
|
||||
# It's possible we could see node types that aren't in our
|
||||
# config
|
||||
if key in states:
|
||||
states[key] += 1
|
||||
else:
|
||||
states[key] = 1
|
||||
|
||||
# nodepool.provider.PROVIDER.nodes.STATE
|
||||
key = 'nodepool.provider.%s.nodes.%s' % (node.provider, node.state)
|
||||
|
@ -81,6 +81,8 @@ class TestLauncher(tests.DBTestCase):
|
||||
self.waitForNodeRequestLockDeletion(req.id)
|
||||
self.assertReportedStat('nodepool.nodes.ready', value='1', kind='g')
|
||||
self.assertReportedStat('nodepool.nodes.building', value='0', kind='g')
|
||||
self.assertReportedStat('nodepool.label.fake-label.nodes.ready',
|
||||
value='1', kind='g')
|
||||
|
||||
def test_node_assignment_order(self):
|
||||
"""Test that nodes are assigned in the order requested"""
|
||||
|
Loading…
x
Reference in New Issue
Block a user