Skip to content

Commit

Permalink
Drop debug output
Browse files Browse the repository at this point in the history
  • Loading branch information
mrunge authored and mergify[bot] committed Feb 22, 2021
1 parent a6ece4b commit 1f3b15a
Showing 1 changed file with 17 additions and 23 deletions.
40 changes: 17 additions & 23 deletions gnocchi/incoming/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,23 +113,20 @@ def update_report(results, m_list):
metrics = 0
m_list = []
pipe = self._client.pipeline()
try:
for key in self._client.scan_iter(match=match, count=1000):
metrics += 1
pipe.llen(key)
if details:
m_list.append(key.split(redis.SEP)[1].decode("utf8"))
# group 100 commands/call
if metrics % 100 == 0:
results = pipe.execute()
update_report(results, m_list)
m_list = []
pipe = self._client.pipeline()
else:
for key in self._client.scan_iter(match=match, count=1000):
metrics += 1
pipe.llen(key)
if details:
m_list.append(key.split(redis.SEP)[1].decode("utf8"))
# group 100 commands/call
if metrics % 100 == 0:
results = pipe.execute()
update_report(results, m_list)
except ConnectionError:
LOG.debug("Redis Server closed connection. Retrying.")
m_list = []
pipe = self._client.pipeline()
else:
results = pipe.execute()
update_report(results, m_list)
return (metrics, report_vars['measures'],
report_vars['metric_details'] if details else None)

Expand Down Expand Up @@ -197,14 +194,11 @@ def iter_on_sacks_to_process(self):
keyspace = b"__keyspace@" + str(db).encode() + b"__:"
pattern = keyspace + self._get_sack_name("*").encode()
p.psubscribe(pattern)
try:
for message in p.listen():
if message['type'] == 'pmessage' and message['pattern'] == pattern:
# FIXME(jd) This is awful, we need a better way to extract this
# Format is defined by _get_sack_name: incoming128-17
yield self._make_sack(int(message['channel'].split(b"-")[-1]))
except ConnectionError:
LOG.debug("Redis Server closed connection. Retrying.")
for message in p.listen():
if message['type'] == 'pmessage' and message['pattern'] == pattern:
# FIXME(jd) This is awful, we need a better way to extract this
# Format is defined by _get_sack_name: incoming128-17
yield self._make_sack(int(message['channel'].split(b"-")[-1]))

def finish_sack_processing(self, sack):
# Delete the sack key which handles no data but is used to get a SET
Expand Down

0 comments on commit 1f3b15a

Please sign in to comment.