Skip to content

Instantly share code, notes, and snippets.

Created August 26, 2014 14:00
Show Gist options
  • Save anonymous/2503f3e70666dc0b5267 to your computer and use it in GitHub Desktop.
Save anonymous/2503f3e70666dc0b5267 to your computer and use it in GitHub Desktop.
def _reset_queues():
cli = client.Client(CONF.server_url)
for i in range(CONF.num_queues):
# TODO(kgriffs): DRY up name generation so it is done
# in a helper, vs. being copy-pasted everywhere.
queue = cli.queue(CONF.queue_prefix + '-' + str(i))
queue.delete()
def main():
CONF(project='zaqar', prog='zaqar-benchmark')
# NOTE(kgriffs): Reset queues since last time. We don't
# clean them up after the performance test, in case
# the user wants to examine the state of the system.
if not CONF.skip_queue_reset:
if CONF.verbose:
print('Resetting queues...')
_reset_queues()
downstream_queue = mp.Queue()
procs = [mp.Process(target=worker.run, args=(downstream_queue,))
for worker in [producer, consumer, observer]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment