Embedded pub and sub client into same process of the plain test broker to use same nanosecs

This commit is contained in:
andsel
2016-12-24 15:36:20 +01:00
parent 43f56a8f39
commit 686c5f4c65
9 changed files with 403 additions and 25 deletions
@@ -86,11 +86,12 @@ class BenchmarkPublisher {
//initialize the timer
PlatformTimer timer = PlatformTimer.detect()
def pubCallback = new PublishCallback()
println ""
(1..numToSend).each {
long nanos = System.nanoTime()
byte[] message = "Hello world!!-${nanos}".bytes
this.client.publish("/topic" + dialog_id, message, qos, retain, null, pubCallback)
print ".\n"
print '.'
timer.sleep(pauseMicroseconds)
}