Skip to content
Snippets Groups Projects
Commit 47ce0ee3 authored by Vermaat's avatar Vermaat
Browse files

Clarify Redis client import in stats module

parent 4e4798c5
No related branches found
No related tags found
No related merge requests found
...@@ -21,7 +21,7 @@ from __future__ import unicode_literals ...@@ -21,7 +21,7 @@ from __future__ import unicode_literals
import time import time
from mutalyzer.redisclient import client from .redisclient import client as redis
# Label, bucket definition, expiration time in seconds. # Label, bucket definition, expiration time in seconds.
...@@ -34,7 +34,7 @@ def increment_counter(counter): ...@@ -34,7 +34,7 @@ def increment_counter(counter):
""" """
Increment the specified counter. Increment the specified counter.
""" """
pipe = client.pipeline(transaction=False) pipe = redis.pipeline(transaction=False)
pipe.incr('counter:%s:total' % counter) pipe.incr('counter:%s:total' % counter)
for label, bucket, expire in INTERVALS: for label, bucket, expire in INTERVALS:
...@@ -56,9 +56,9 @@ def get_totals(): ...@@ -56,9 +56,9 @@ def get_totals():
Known counters are just those that have been incremented at least once. Known counters are just those that have been incremented at least once.
""" """
counters = client.keys('counter:*:total') counters = redis.keys('counter:*:total')
pipe = client.pipeline(transaction=False) pipe = redis.pipeline(transaction=False)
for counter in counters: for counter in counters:
pipe.get(counter) pipe.get(counter)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment