Merge "Record provider AZ info in graphite."

This commit is contained in:
Jenkins 2014-08-05 19:26:14 +00:00 committed by Gerrit Code Review
commit cdb1e87c23

View File

@ -346,7 +346,8 @@ class NodeLauncher(threading.Thread):
try:
self.nodepool.launchStats(statsd_key, dt, self.image.name,
self.provider.name,
self.target.name)
self.target.name,
self.node.az)
except Exception:
self.log.exception("Exception reporting launch stats:")
@ -590,7 +591,8 @@ class SubNodeLauncher(threading.Thread):
try:
self.nodepool.launchStats(statsd_key, dt, self.image.name,
self.provider.name,
self.node_target_name)
self.node_target_name,
self.node_az)
except Exception:
self.log.exception("Exception reporting launch stats:")
@ -1817,18 +1819,24 @@ class NodePool(threading.Thread):
key = 'nodepool.provider.%s.max_servers' % provider.name
statsd.gauge(key, provider.max_servers)
def launchStats(self, subkey, dt, image_name, provider_name, target_name):
def launchStats(self, subkey, dt, image_name,
provider_name, target_name, node_az):
if not statsd:
return
#nodepool.launch.provider.PROVIDER.subkey
#nodepool.launch.image.IMAGE.subkey
#nodepool.launch.target.TARGET.subkey
#nodepool.launch.subkey
for key in [
keys = [
'nodepool.launch.provider.%s.%s' % (provider_name, subkey),
'nodepool.launch.image.%s.%s' % (image_name, subkey),
'nodepool.launch.target.%s.%s' % (target_name, subkey),
'nodepool.launch.%s' % (subkey,),
]:
]
if node_az:
#nodepool.launch.provider.PROVIDER.AZ.subkey
keys.append('nodepool.launch.provider.%s.%s.%s' %
(provider_name, node_az, subkey))
for key in keys:
statsd.timing(key, dt)
statsd.incr(key)