[jboss-svn-commits] JBL Code SVN: r15560 - labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Oct 3 16:41:13 EDT 2007
Author: james.williams at jboss.com
Date: 2007-10-03 16:41:13 -0400 (Wed, 03 Oct 2007)
New Revision: 15560
Removed:
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy
labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
Log:
changed logic so it is less groovy hack-ish and more POJO friendly. Also switched to xml based config so more options
can be supported.
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy 2007-10-03 20:40:47 UTC (rev 15559)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/JMSLoadAgent.groovy 2007-10-03 20:41:13 UTC (rev 15560)
@@ -1,91 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA 02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-
-import javax.jms.JMSException
-import javax.jms.ObjectMessage
-import javax.jms.Queue
-import javax.jms.QueueConnection
-import javax.jms.QueueConnectionFactory
-import javax.jms.QueueSender
-import javax.jms.QueueSession
-import javax.naming.Context
-import javax.naming.InitialContext
-import javax.naming.NamingException
-
-/**
- * Simple Groovy load script that will simulate load for a JMS gateway based ESB service call.
- *
- * @author <a href="mailto:james.williams at redhat.com">james.williams at redhat.com</a>
- */
-
-def Properties props = new Properties()
-props.load(new File("load_generator_classes/load.properties").newInputStream())
-
-def msgCount = props.getProperty("msgCount").toLong()
-def batchCount = props.getProperty("batchCount").toInteger()
-def batchInterval = props.getProperty("batchInterval").toInteger()
-def loadAgentWaitTime = props.getProperty("loadAgentWaitTime").toInteger() * 1000
-def payload = "load_generator_classes/" + props.getProperty("payload")
-def queue = props.getProperty("queue")
-def batchNum = 1
-
-sleep(loadAgentWaitTime)
-
-1.upto(batchCount) {
- setupConnection(queue)
- QueueSender send = session.createSender(que)
- ObjectMessage tm = session.createObjectMessage(new File(payload).text)
- println "Sending batch $batchNum of $batchCount"
- 1.upto(msgCount) {
- send.send(tm)
- }
-
- send.close()
- sleep(batchInterval*1000)
- batchNum++
-}
-
-closeConnection()
-
-def setupConnection(queue) {
- Properties properties1 = new Properties()
- properties1.put(Context.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory")
- properties1.put(Context.URL_PKG_PREFIXES,"org.jboss.naming:org.jnp.interfaces")
- properties1.put(Context.PROVIDER_URL, "jnp://127.0.0.1:1099")
- InitialContext iniCtx = new InitialContext(properties1)
-
- Object tmp = iniCtx.lookup("ConnectionFactory")
- QueueConnectionFactory qcf = (QueueConnectionFactory) tmp
- conn = qcf.createQueueConnection()
- que = (Queue) iniCtx.lookup(queue)
- session = conn.createQueueSession(false, QueueSession.AUTO_ACKNOWLEDGE)
- conn.start()
-}
-
-def closeConnection() {
- conn.stop();
- session.close();
- conn.close();
-}
-
-println "All Messages have been delivered"
-
-
-
Deleted: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties 2007-10-03 20:40:47 UTC (rev 15559)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties 2007-10-03 20:41:13 UTC (rev 15560)
@@ -1,38 +0,0 @@
-#comma separated list of services to report on
-serviceList = DummyJMSLoad,DummyJMSLoad2
-
-#check this JMS queue for messages. report will stop if this queue is empty
-#your fastest service's listener queue should be used here. Notice the JMX specific syntax.
-#This is the only optional property.
-#If commented out, the report will run until killed at the console
-fastestServiceQueue = jboss.esb.quickstart.destination:service=Queue,name=quickstart_load_generator_Request_esb
-
-#ESB archive that contains the services
-esbArchive = Quickstart_load_generator.esb
-
-#Payload File (Contents of the test message)
-payload = payload.xml
-
-#Agent will send load to this JMS queue
-queue = queue/quickstart_load_generator_Request_gw
-
-#Calculate TPS once per second is default (value in seconds)
-tpsInterval = 1
-
-#Message Count per batch for Churn Agent
-#Needs to be higher than the service processing throughput to generate good TPS info
-msgCount = 1000
-
-#Number of message batches. Total number of messages can be calculated as (msgCount * batchCount)
-batchCount = 10
-
-#How long to wait, in seconds between message batches
-batchInterval = 1
-
-#Load Agent waits this many seconds before sending it's first message batch
-loadAgentWaitTime = 1
-
-#Report Log Location
-#Report agent will create CSV with a name like 'esb-load-generator-$TIMESTAMP.csv' here
-logLocation = /tmp/esb-load-logs
-
More information about the jboss-svn-commits
mailing list