activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From chir...@apache.org
Subject svn commit: r1002773 - 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/
Date Wed, 29 Sep 2010 17:35:22 GMT
Author: chirino
Date: Wed Sep 29 17:35:22 2010
New Revision: 1002773

URL: http://svn.apache.org/viewvc?rev=1002773&view=rev
Log:
Putting scenarios in traits so that they can more easily be mixed in to form different combinations.

Added:
    activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasicScenarios.scala
      - copied, changed from r1002772, 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/DeepQueueScenarios.scala
      - copied, changed from r1002772, 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/PersistentScenario.scala
Removed:
    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
Modified:
    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

Copied: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasicScenarios.scala
(from r1002772, 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/BasicScenarios.scala?p2=activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasicScenarios.scala&p1=activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BaseBrokerPerfSupport.scala&r1=1002772&r2=1002773&rev=1002773&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/BasicScenarios.scala
Wed Sep 29 17:35:22 2010
@@ -22,12 +22,9 @@ import java.net.URL
 /**
  * 
  */
-abstract class BaseBrokerPerfSupport extends BrokerPerfSupport {
+trait BasicScenarios extends BrokerPerfSupport {
 
-  def reportResourceTemplate():URL = { classOf[BaseBrokerPerfSupport].getResource("report.html")
}
-  def partitionedLoad = List(1, 2, 4, 8, 10)
-  def highContention = 10
-  def messageSizes = List(20,1024,1024*256)
+  def reportResourceTemplate():URL = { classOf[BasicScenarios].getResource("report.html")
}
 
   // benchmark all the combinations
   for( ptp <- List(true,false) ; durable <- List(false) ; messageSize <- messageSizes
) {

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=1002773&r1=1002772&r2=1002773&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:35:22 2010
@@ -82,6 +82,10 @@ abstract class BrokerPerfSupport extends
 
   var samples:List[(String, AnyRef)] = Nil
 
+  def partitionedLoad = List(1, 2, 4, 8, 10)
+  def highContention = 10
+  def messageSizes = List(20,1024,1024*256)
+
   override protected def beforeEach() = {
     totalProducerRate = new MetricAggregator().name("Aggregate Producer Rate").unit("items")
     totalConsumerRate = new MetricAggregator().name("Aggregate Consumer Rate").unit("items")
@@ -496,12 +500,15 @@ abstract class RemoteConnection extends 
 
   protected def incrementMessageCount() = {
     messageCount = messageCount + 1
-    if ( messageCount % (maxMessages / 10) == 0 ) {
-      trace(name + " message count : " + messageCount)
-    }
-    if (maxMessages > 0 && messageCount  == maxMessages) {
-      trace(name + " message count (" + messageCount + ") max (" + maxMessages + ") reached,
stopping connection")
-      doStop
+    if( maxMessages > 0 ) {
+      if ( messageCount % (maxMessages / 10) == 0 ) {
+        trace(name + " message count : " + messageCount)
+      }
+      if (messageCount == maxMessages) {
+        trace(name + " message count (" + messageCount + ") max (" + maxMessages + ") reached,
stopping connection")
+        doStop
+      }
+
     }
   }
 

Copied: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/DeepQueueScenarios.scala
(from r1002772, 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/DeepQueueScenarios.scala?p2=activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/DeepQueueScenarios.scala&p1=activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/BasePersistentBrokerPerfSupport.scala&r1=1002772&r2=1002773&rev=1002773&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/DeepQueueScenarios.scala
Wed Sep 29 17:35:22 2010
@@ -24,17 +24,17 @@ import java.net.URL
  *
  * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
  */
-abstract class BasePersistentBrokerPerfSupport extends BaseBrokerPerfSupport {
+trait DeepQueueScenarios extends PersistentScenario {
 
   PERSISTENT = true
 
-  override def reportResourceTemplate():URL = { classOf[BasePersistentBrokerPerfSupport].getResource("persistent-report.html")
}
+  override def reportResourceTemplate():URL = { classOf[DeepQueueScenarios].getResource("persistent-report.html")
}
 
   //override def partitionedLoad = List(1, 2, 4, 8, 10)
   override def highContention = 100
   //override def messageSizes = List(20, 1024, 1024*256)
 
-  for ( load <- partitionedLoad ; messageSize <- messageSizes ) {
+  for ( load <- partitionedLoad ; messageSize <- List(20,1024)  ) {
 
     val totalMessages = 100000
     val numMessages = totalMessages / load

Added: activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/PersistentScenario.scala
URL: http://svn.apache.org/viewvc/activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/PersistentScenario.scala?rev=1002773&view=auto
==============================================================================
--- activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/PersistentScenario.scala
(added)
+++ activemq/activemq-apollo/trunk/apollo-broker/src/test/scala/org/apache/activemq/apollo/broker/perf/PersistentScenario.scala
Wed Sep 29 17:35:22 2010
@@ -0,0 +1,29 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.activemq.apollo.broker.perf
+
+/**
+ * <p>
+ * </p>
+ *
+ * @author <a href="http://hiramchirino.com">Hiram Chirino</a>
+ */
+trait PersistentScenario extends BrokerPerfSupport {
+
+  PERSISTENT = true
+
+}
\ No newline at end of file

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=1002773&r1=1002772&r2=1002773&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:35:22 2010
@@ -34,66 +34,38 @@ import org.apache.activemq.apollo.dto.{B
 import org.apache.activemq.apollo.store.bdb.dto.BDBStoreDTO
 
 
-class StompBrokerPerfTest extends BaseBrokerPerfSupport {
-
+class BasicNonPersistentTest extends BasicScenarios with StompScenario {
   override def description = "Using the STOMP protocol over TCP"
-
-  override def createProducer() = new StompRemoteProducer()
-
-  override def createConsumer() = new StompRemoteConsumer()
-
-  override def getRemoteProtocolName() = "stomp"
-
 }
 
-class StompPersistentBrokerPerfTest extends BasePersistentBrokerPerfSupport {
-
-  override def description = "Using the STOMP protocol over TCP with no store."
-
-  override def createProducer() = new StompRemoteProducer()
-
-  override def createConsumer() = new StompRemoteConsumer()
-
-  override def getRemoteProtocolName() = "stomp"
-
+class BasicHawtDBTest extends BasicScenarios with PersistentScenario with HawtDBScenario
with StompScenario {
+  override def description = "Using the STOMP protocol over TCP"
 }
 
-class StompHawtDBPersistentBrokerPerfTest extends BasePersistentBrokerPerfSupport {
-  
+class DeepQueueHawtDBTest extends DeepQueueScenarios with HawtDBScenario with StompScenario
{
   override def description = "Using the STOMP protocol over TCP persisting to the HawtDB
store."
+}
 
-  println(getClass.getClassLoader.getResource("log4j.properties"))
+class DeepQueueBDBTest extends DeepQueueScenarios with BDBScenario with StompScenario {
+  override def description = "Using the STOMP protocol over TCP persisting to the BerkleyDB
store."
+}
 
+trait StompScenario extends BrokerPerfSupport {
   override def createProducer() = new StompRemoteProducer()
-
   override def createConsumer() = new StompRemoteConsumer()
- 
   override def getRemoteProtocolName() = "stomp"
+}
 
+trait HawtDBScenario extends BrokerPerfSupport {
   override def createBrokerConfig(name: String, bindURI: String, connectUri: String): BrokerDTO
= {
     val rc = super.createBrokerConfig(name, bindURI, connectUri)
-
     val store = new HawtDBStoreDTO
     store.directory = new File(new File(testDataDir, getClass.getName), name)
-
     rc.virtual_hosts.get(0).store = store
     rc
   }
-
 }
-
-class StompBDBPersistentBrokerPerfTest extends BasePersistentBrokerPerfSupport {
-
-  override def description = "Using the STOMP protocol over TCP persisting to the BerkleyDB
store."
-
-  println(getClass.getClassLoader.getResource("log4j.properties"))
-
-  override def createProducer() = new StompRemoteProducer()
-
-  override def createConsumer() = new StompRemoteConsumer()
-
-  override def getRemoteProtocolName() = "stomp"
-
+trait BDBScenario extends BrokerPerfSupport {
   override def createBrokerConfig(name: String, bindURI: String, connectUri: String): BrokerDTO
= {
     val rc = super.createBrokerConfig(name, bindURI, connectUri)
 
@@ -103,10 +75,8 @@ class StompBDBPersistentBrokerPerfTest e
     rc.virtual_hosts.get(0).store = store
     rc
   }
-
 }
 
-
 class StompRemoteConsumer extends RemoteConsumer with Logging {
   var outboundSink: OverflowSink[StompFrame] = null
 



Mime
View raw message