You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2010/09/29 19:34:28 UTC
svn commit: r1002768 - in /activemq/activemq-apollo/trunk:
apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/
apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/
Author: chirino
Date: Wed Sep 29 17:34:28 2010
New Revision: 1002768
URL: http://svn.apache.org/viewvc?rev=1002768&view=rev
Log:
fix the tests I broke.
Modified:
activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala
activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala
activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala?rev=1002768&r1=1002767&r2=1002768&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala Wed Sep 29 17:34:28 2010
@@ -17,8 +17,6 @@
package org.apache.activemq.apollo.broker.perf
import _root_.org.apache.activemq.apollo.util.metric.{Period}
-import org.apache.activemq.apollo.broker._
-import _root_.org.fusesource.hawtbuf._
import java.net.URL
/**
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala?rev=1002768&r1=1002767&r2=1002768&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala Wed Sep 29 17:34:28 2010
@@ -33,17 +33,24 @@ abstract class BasePersistentBrokerPerfS
override def highContention = 100
for ( load <- partitionedLoad ; messageSize <- messageSizes ) {
+
val numMessages = 1000000 / load
- val info = "queue " + numMessages + " " + (if((messageSize%1024)==0) (messageSize/1024)+"k" else messageSize+"b" ) + " with " + load + " "
+ def benchmark(name: String)(func: => Unit) {
+ test(name) {
+ MAX_MESSAGES = numMessages
+ PTP = true
+ MESSAGE_SIZE = messageSize
+ destCount = 1;
+ func
+ }
+ }
+
+ val info = "queue " + numMessages + " " + (if((messageSize%1024)==0) (messageSize/1024)+"k" else messageSize+"b" ) + " with " + load + " "
- test("En" + info + "producer(s)") {
- MAX_MESSAGES = numMessages
- PTP = true
- PURGE_STORE = true
- MESSAGE_SIZE = messageSize
+ benchmark("En" + info + "producer(s)") {
+ PURGE_STORE = true
producerCount = load;
- destCount = 1;
createConnections();
// Start 'em up.
@@ -55,13 +62,9 @@ abstract class BasePersistentBrokerPerfS
}
}
- test("De" + info + "consumer(s)") {
- MAX_MESSAGES = numMessages
- PTP = true
+ benchmark("De" + info + "consumer(s)") {
PURGE_STORE = false
- MESSAGE_SIZE = messageSize
consumerCount = load;
- destCount = 1;
createConnections();
// Start 'em up.
Modified: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala?rev=1002768&r1=1002767&r2=1002768&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BrokerPerfSupport.scala Wed Sep 29 17:34:28 2010
@@ -362,10 +362,10 @@ abstract class BrokerPerfSupport extends
val p = new Period()
Thread.sleep(SAMPLE_PERIOD)
if (producerCount > 0) {
- println(totalProducerRate.getRateSummary(p))
+ trace(totalProducerRate.getRateSummary(p))
}
if (consumerCount > 0) {
- println(totalConsumerRate.getRateSummary(p))
+ trace(totalConsumerRate.getRateSummary(p))
}
sample_rates += Summary(totalProducerRate.total(p), totalProducerRate.deviation, totalConsumerRate.total(p), totalConsumerRate.deviation)
Modified: activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala?rev=1002768&r1=1002767&r2=1002768&view=diff
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala (original)
+++ activemq/activemq-apollo/trunk/apollo-stomp/src/test/scala/org/apache/activemq/apollo/stomp/perf/StompBrokerPerfTest.scala Wed Sep 29 17:34:28 2010
@@ -140,7 +140,6 @@ class StompRemoteConsumer extends Remote
frame match {
case StompFrame(Responses.CONNECTED, headers, _, _) =>
case StompFrame(Responses.MESSAGE, headers, content, _) =>
- if (maxMessages > 0 && messageCount < maxMessages - 1) {
messageReceived();
// we client ack if persistent messages are being used.
@@ -152,9 +151,9 @@ class StompRemoteConsumer extends Remote
if ( messageCount % 10000 == 0 ) {
trace("Received message count : " + messageCount)
}
- } else {
- stop()
- }
+ if (maxMessages > 0 && messageCount >= maxMessages) {
+ stop()
+ }
case StompFrame(Responses.ERROR, headers, content, _) =>
onFailure(new Exception("Server reported an error: " + frame.content));
@@ -185,7 +184,6 @@ class StompRemoteProducer extends Remote
var frame:StompFrame = null
def send_next: Unit = {
- if (maxMessages > 0 && messageCount < maxMessages) {
var headers: List[(AsciiBuffer, AsciiBuffer)] = Nil
headers ::= (Stomp.Headers.Send.DESTINATION, stompDestination);
if (property != null) {
@@ -205,10 +203,10 @@ class StompRemoteProducer extends Remote
if ( messageCount % 10000 == 0 ) {
trace("Sent message count : " + messageCount)
}
+ if (maxMessages > 0 && messageCount >= maxMessages) {
+ stop()
+ }
drain()
- } else {
- stop()
- }
}
def drain() = {