Adds Zaqar consumer-producer scenario

This scenario for Zaqar benchmarks a serial consumer-producer
use case: creates a queue, sends messages to it, retrieves
messages from it and deletes the queue.

Some changes have been added to the fakes to test this
scenario properly.

Change-Id: I49d5956bbf571840829b3e9b1411a907748cf1ed
This commit is contained in:
Victoria Martínez de la Cruz 2014-11-24 20:18:59 -03:00 committed by Victoria Martinez de la Cruz
parent 8f91157e67
commit 7f5e422dbd
2 changed files with 18 additions and 1 deletions

View File

@ -10,3 +10,17 @@
sla:
failure_rate:
max: 0
ZaqarBasic.producer_consumer:
-
args:
name_length: 10
min_msg_count: 50
max_msg_count: 200
runner:
type: "constant"
times: 100
concurrency: 10
sla:
failure_rate:
max: 0

View File

@ -248,10 +248,13 @@ class FakeQueue(FakeResource):
self.queue_name = name
self.messages = FakeMessagesManager(name)
def post_message(self, messages):
def post(self, messages):
for msg in messages:
self.messages.create(**msg)
def messages(self):
return self.messages.list()
class FakeDbInstance(FakeResource):
pass