Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
stomp client test script
<?php
/**
* Test Stomp Throughput
* @author Shane Harter
*/
require 'stomp/Stomp.php';
$start = microtime(true);
$stomp = new Stomp('tcp://localhost:61613');
$stomp->connect();
$queue = 'shane_test';
$persistent = false;
$message_size = 20;
$message = str_repeat(1, $message_size);
$count = 0;
echo PHP_EOL, "Beginning Test...";
while(microtime(true) - $start < 30) {
$stomp->send($queue, $message, array('persistent' => $persistent));
$count++;
}
echo PHP_EOL, "Client: Stomp\tPersistent: {$persistent}\tMessage Size: {$message_size}\tCount: $count";
echo PHP_EOL;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment