diff --git a/checks.d/postgres.py b/checks.d/postgres.py index 3ea143b690..e35434743e 100644 --- a/checks.d/postgres.py +++ b/checks.d/postgres.py @@ -508,7 +508,8 @@ def _collect_stats(self, key, db, instance_tags, relations, custom_metrics): # v[0] == (metric_name, submit_function) # v[1] == the actual value # tags are - [v[0][1](self, v[0][0], v[1], tags=tags) for v in values] + for v in values: + v[0][1](self, v[0][0], v[1], tags=tags) cursor.close() except InterfaceError, e: diff --git a/checks.d/riak.py b/checks.d/riak.py index bdaa927638..68991691f0 100644 --- a/checks.d/riak.py +++ b/checks.d/riak.py @@ -51,7 +51,8 @@ class Riak(AgentCheck): def __init__(self, name, init_config, agentConfig, instances=None): AgentCheck.__init__(self, name, init_config, agentConfig, instances) for k in ["mean", "median", "95", "99", "100"]: - [self.keys.append(m + "_" + k) for m in self.stat_keys] + for m in self.stat_keys: + self.keys.append(m + "_" + k) self.prev_coord_redirs_total = -1 @@ -81,7 +82,9 @@ def check(self, instance): self.service_check( self.SERVICE_CHECK_NAME, AgentCheck.OK, tags=service_check_tags) - [self.gauge("riak." + k, stats[k], tags=tags) for k in self.keys if k in stats] + for k in self.keys: + if k in stats: + self.gauge("riak." + k, stats[k], tags=tags) coord_redirs_total = stats["coord_redirs_total"] if self.prev_coord_redirs_total > -1: