Merge "Improve a bit performance of Ceilometer"

This commit is contained in:
Jenkins 2014-07-16 10:51:55 +00:00 committed by Gerrit Code Review
commit 9b695e8761
4 changed files with 9 additions and 9 deletions

View File

@ -130,8 +130,8 @@ class AnalyticsAPIBaseClient(object):
dump.append('HTTP %.1f %s %s\n' % (resp.raw.version, dump.append('HTTP %.1f %s %s\n' % (resp.raw.version,
resp.status_code, resp.status_code,
resp.reason)) resp.reason))
dump.extend(['%s: %s\n' % (k, v) dump.extend('%s: %s\n' % (k, v)
for k, v in six.iteritems(resp.headers)]) for k, v in six.iteritems(resp.headers))
dump.append('\n') dump.append('\n')
if resp.content: if resp.content:
dump.extend([resp.content, '\n']) dump.extend([resp.content, '\n'])

View File

@ -213,8 +213,8 @@ class Client():
dump.append('HTTP %.1f %s %s\n' % (resp.raw.version, dump.append('HTTP %.1f %s %s\n' % (resp.raw.version,
resp.status_code, resp.status_code,
resp.reason)) resp.reason))
dump.extend(['%s: %s\n' % (k, v) dump.extend('%s: %s\n' % (k, v)
for k, v in six.iteritems(resp.headers)]) for k, v in six.iteritems(resp.headers))
dump.append('\n') dump.append('\n')
if resp.content: if resp.content:
dump.extend([resp.content, '\n']) dump.extend([resp.content, '\n'])

View File

@ -68,9 +68,9 @@ class NotificationBase(PluginBase):
targets = [] targets = []
for exchange, topics in self.get_exchange_topics(conf): for exchange, topics in self.get_exchange_topics(conf):
targets.extend([oslo.messaging.Target(topic=topic, targets.extend(oslo.messaging.Target(topic=topic,
exchange=exchange) exchange=exchange)
for topic in topics]) for topic in topics)
return targets return targets
@abc.abstractmethod @abc.abstractmethod

View File

@ -200,9 +200,9 @@ def get_meter_columns(metaquery, **kwargs):
column name in db column name in db
""" """
columns = ['f:message', 'f:recorded_at'] columns = ['f:message', 'f:recorded_at']
columns.extend(["f:%s" % k for k, v in kwargs.items() if v]) columns.extend("f:%s" % k for k, v in kwargs.items() if v)
if metaquery: if metaquery:
columns.extend(["f:r_%s" % k for k, v in metaquery.items() if v]) columns.extend("f:r_%s" % k for k, v in metaquery.items() if v)
return columns return columns