[jboss-svn-commits] JBL Code SVN: r15480 - labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Oct 1 07:34:35 EDT 2007


Author: james.williams at jboss.com
Date: 2007-10-01 07:34:35 -0400 (Mon, 01 Oct 2007)
New Revision: 15480

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
Log:
made a property optional and enhanced the log generation
a little bit. Now, logs are clean CSVs that can be imported
into Open Office or Excel easily.

Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy	2007-10-01 11:09:33 UTC (rev 15479)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/LoadReport.groovy	2007-10-01 11:34:35 UTC (rev 15480)
@@ -10,8 +10,7 @@
  */
 def Properties props = new Properties()
 props.load(new File("load_generator_classes/load.properties").newInputStream())
-def File reportLog = new File(props.getProperty("logFile") + "-" + new Date().getTime());
-
+def File reportLog = new File(props.getProperty("logLocation") + "/esb-load-generator-" + new Date().getTime() + ".csv");
 def fastestServiceQueue = props.getProperty("fastestServiceQueue") 
 def serviceList = props.getProperty("serviceList").split(',')
 def esbArchive = props.getProperty("esbArchive")
@@ -29,10 +28,12 @@
 
 InitialContext ctx = new InitialContext(); // From jndi.properties
 MBeanServerConnection server = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor")
-
+reportLog.getParentFile().mkdirs()
+reportLog.append("Service, TPS, AVG TPS, Sample Count, Duration\n")
+ 	
 while(!done) {	
     println ""
- 	serviceList.each {
+    serviceList.each {
  		service ->
 		processedMsgsBefore = server.getAttribute(new ObjectName("jboss.esb:service-name=$service,deployment=$esbArchive,category=MessageCounter"), "overall service message count").toLong()
  		sleep(tpsInterval*1000)
@@ -46,14 +47,17 @@
  		long tpsSum = statsMap."$service-TPSSum" 		
  		
  		long duration =  seconds / 60
- 		println "Service: $service, TPS: $tps, AVG TPS: $avgTPS, Sample Count: $tpsSum, Duration: $duration" 
- 		reportLog.append("Service: $service, TPS: $tps, AVG TPS: $avgTPS, Sample Count: $tpsSum, Duration: $duration \n")
+ 		println "Svc: $service, TPS: $tps, AVG TPS: $avgTPS, Samples: $tpsSum, Duration: $duration" 
+ 		reportLog.append("$service, $tps, $avgTPS, $tpsSum, $duration \n")
  		seconds += tpsInterval
  		
- 		queueDepthCheck = server.getAttribute(new ObjectName("$fastestServiceQueue"), "QueueDepth").toLong()
- 		if (queueDepthCheck == 0){
- 			done = true
- 		} 		
+ 		if (fastestServiceQueue != null)
+ 		{
+ 			queueDepthCheck = server.getAttribute(new ObjectName("$fastestServiceQueue"), "QueueDepth").toLong()
+ 			if (queueDepthCheck == 0){
+ 				done = true
+ 			} 
+ 		}				
  	} 	 	
 }  
     

Modified: labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties	2007-10-01 11:09:33 UTC (rev 15479)
+++ labs/jbossesb/trunk/product/samples/quickstarts/load_generator/scripts/load.properties	2007-10-01 11:34:35 UTC (rev 15480)
@@ -2,7 +2,9 @@
 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
+#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
@@ -18,7 +20,8 @@
 tpsInterval = 1
 
 #Message Count per batch for Churn Agent
-msgCount = 500
+#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
@@ -30,5 +33,6 @@
 loadAgentWaitTime = 1
 
 #Report Log Location
-logFile = /tmp/load_generator.log
+#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