Skip to content
This repository was archived by the owner on Jun 22, 2022. It is now read-only.

Commit 8f040d1

Browse files
author
Greg Rice
committed
Testing code for multiple vhosts - removed refreshGroup
1 parent 39354b4 commit 8f040d1

1 file changed

Lines changed: 0 additions & 29 deletions

File tree

rabbit/python_modules/rabbitmq.py

Lines changed: 0 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -103,35 +103,6 @@ def refreshStats(stats = ('nodes', 'queues'), vhosts = ['/']):
103103

104104
return compiled_results
105105

106-
def refreshGroup(group):
107-
# No longer in use in the multiple_vhosts version
108-
109-
global url_template
110-
urlstring = url_template.safe_substitute(stats = group, vhost = vhost)
111-
112-
global last_update, url, compiled_results
113-
114-
now = time.time()
115-
if not last_update[(group, vhost)]:
116-
diff = INTERVAL
117-
else:
118-
diff = now - last_update[(group, vhost)]
119-
120-
if diff >= INTERVAL or not last_update[(group, vhost)]:
121-
result_dict = {}
122-
print "Fetching stats after %d seconds" % INTERVAL
123-
result = json.load(urllib.urlopen(urlstring))
124-
compiled_results[(group, vhost)] = result
125-
last_update[(group, vhost)] = now
126-
#Refresh dict by names. We'll probably move this elsewhere.
127-
if group in ('queues', 'nodes'):
128-
for entry in result:
129-
name_attribute = entry['name']
130-
result_dict[name_attribute] = entry
131-
compiled_results[(group,vhost)] = result_dict
132-
133-
return compiled_results[(group, vhost)]
134-
135106
def validatedResult(value):
136107
if not isInstance(value, bool):
137108
return float(value)

0 commit comments

Comments
 (0)