Permalink
Browse files

Testing code for multiple vhosts - removed refreshGroup

  • Loading branch information...
1 parent 39354b4 commit 8f040d1549b54bd56880842dcdfaa2f5ee6f2b9d Greg Rice committed Jul 5, 2012
Showing with 0 additions and 29 deletions.
  1. +0 −29 rabbit/python_modules/rabbitmq.py
View
29 rabbit/python_modules/rabbitmq.py
@@ -103,35 +103,6 @@ def refreshStats(stats = ('nodes', 'queues'), vhosts = ['/']):
return compiled_results
-def refreshGroup(group):
- # No longer in use in the multiple_vhosts version
-
- global url_template
- urlstring = url_template.safe_substitute(stats = group, vhost = vhost)
-
- global last_update, url, compiled_results
-
- now = time.time()
- if not last_update[(group, vhost)]:
- diff = INTERVAL
- else:
- diff = now - last_update[(group, vhost)]
-
- if diff >= INTERVAL or not last_update[(group, vhost)]:
- result_dict = {}
- print "Fetching stats after %d seconds" % INTERVAL
- result = json.load(urllib.urlopen(urlstring))
- compiled_results[(group, vhost)] = result
- last_update[(group, vhost)] = now
- #Refresh dict by names. We'll probably move this elsewhere.
- if group in ('queues', 'nodes'):
- for entry in result:
- name_attribute = entry['name']
- result_dict[name_attribute] = entry
- compiled_results[(group,vhost)] = result_dict
-
- return compiled_results[(group, vhost)]
-
def validatedResult(value):
if not isInstance(value, bool):
return float(value)

0 comments on commit 8f040d1

Please sign in to comment.