/gist:2503f3e70666dc0b5267 Secret
Created
August 26, 2014 14:00
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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