Adds django cache as monitor cache

Not the best solution yet, but it solves monitoring problems with brokers that don't have a pattern getter for cluster stats.
This commit is contained in:
Ilan Steemers
2015-08-30 18:28:26 +02:00
parent d3283571a6
commit 4f39062785
4 changed files with 39 additions and 12 deletions
+3 -3
View File
@@ -26,14 +26,14 @@ class Redis(Broker):
logger.error('Can not connect to Redis server.')
raise e
def set(self, key, value, timeout):
def set_stat(self, key, value, timeout):
self.connection.set(key, value, timeout)
def get(self, key):
def get_stat(self, key):
if self.connection.exists(key):
return self.connection.get(key)
def get_pattern(self, pattern):
def get_stats(self, pattern):
keys = self.connection.keys(pattern=pattern)
if keys:
return self.connection.mget(keys)