Created
July 3, 2012 18:18
-
-
Save shaneharter/3041528 to your computer and use it in GitHub Desktop.
stomp client test script
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
<?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