[jboss-svn-commits] JBL Code SVN: r34197 - in labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts: common and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 26 12:26:08 EDT 2010


Author: whitingjr
Date: 2010-07-26 12:26:08 -0400 (Mon, 26 Jul 2010)
New Revision: 34197

Added:
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/common/
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/common/common-api.xml
Modified:
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.properties
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.xml
   labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-commands.xml
Log:
Added ability to wait for the benchmark to complete processing. This prevents the benchmark scripts from starting the next benchmark run prematurely.

Modified: labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.properties
===================================================================
--- labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.properties	2010-07-26 16:15:58 UTC (rev 34196)
+++ labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.properties	2010-07-26 16:26:08 UTC (rev 34197)
@@ -15,4 +15,8 @@
 start.jstat.1=jstat -gcutil -t -h12
 start.jstat.2=5s > /jboss-5.1.0.Branch/server/production/log/jstat-hornetq.txt &
 
-server.deployment.dir=/jboss-5.1.0.Branch
\ No newline at end of file
+server.deployment.dir=/jboss-5.1.0.Branch
+
+benchmark.process.name=SPECjmsControlDriver
+
+completion.wait.period.inMilliSeconds=60000

Modified: labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.xml	2010-07-26 16:15:58 UTC (rev 34196)
+++ labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-api.xml	2010-07-26 16:26:08 UTC (rev 34197)
@@ -12,16 +12,18 @@
  permissions and limitations under the License.
   -->
 <!--
-	This file contains the commands that should be called
-	on the command line.
+	This file contains the low level api that should not be called
+	on the command line directly.
 -->
 
-
-<project name="RedHat-JBoss-Performance:Commands" default="usage" basedir=".">
-
+<project name="RedHat-JBoss-Performance:API" default="usage" basedir=".">
+   
    <taskdef name="xmltask" classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>
    <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
+   <taskdef name="groovy" classname="org.codehaus.groovy.ant.Groovy"/>
 
+   <import file="common/common-api.xml"/>
+
    <property file="build-api.properties" />
    <property environment="env"/>
    <property name="framework.properties.dir" location="${env.HOME}/.specjms" />
@@ -425,6 +427,15 @@
       </if>
    </target>
    
+   <target name="wait-for-benchmark-completion">
+      <echo>Checking to see if benchmark has completed.</echo>
+      <antcall target="check-and-wait">
+         <param name="pid.output.file" value= "${jps.output.file}"/>
+         <param name="pid.process.name" value= "${benchmark.process.name}"/>
+         <param name="wait.period.inMinutes" value= "${completion.wait.period}"/>
+      </antcall>
+   </target>
+   
    <target name="usage">
       <echo>usage: Do not call this directly, instead use build-commands</echo>
    </target>

Modified: labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-commands.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-commands.xml	2010-07-26 16:15:58 UTC (rev 34196)
+++ labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/build-commands.xml	2010-07-26 16:26:08 UTC (rev 34197)
@@ -11,10 +11,9 @@
  implied.  See the License for the specific language governing
  permissions and limitations under the License.
   -->
- <!-- This file should not be called directly on the command line.
-  	Use instead the build-commands.xml instead.
+ <!-- This file should be called directly on the command line.
   -->
-<project name="RedHat-JBoss-Performance:API" default="usage" >
+<project name="RedHat-JBoss-Performance:Commands" default="usage" >
 
    <property file="build-commands.properties" />
    
@@ -24,16 +23,11 @@
 		<ant antfile="build-api.xml" target="prepare-eap-server"/>
 		<ant antfile="build-api.xml" target="gather-configuration"/>
 		<ant antfile="build-api.xml" target="start-benchmark"/>
-	   <tstamp>
-	      <format  offset="${benchmark.run.duration.inMinutes}" pattern="HH:mm" property="resume.time" unit="minute"/>
-	   </tstamp>
-	   <echo>Waiting ${benchmark.run.duration.inMinutes} minutes to allow the benchmark to complete. Resuming at ${resume.time}.</echo>
-	   <sleep minutes="${benchmark.run.duration.inMinutes}"/>
+	   <ant antfile="build-api.xml" target="wait-for-benchmark-completion"/>
 	   <ant antfile="build-api.xml" target="stop-eap-server"/>
 	   <ant antfile="build-api.xml" target="gather-logs"/>
 	   <ant antfile="build-api.xml" target="process-gc-stats"/>
 	   <ant antfile="build-api.xml" target="verify-log-collection"/>
-	   <!--ant antfile="build-api.xml" target="generate-submission"/-->
 	</target>
    
    <target name="substitute-remote-config">

Added: labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/common/common-api.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/common/common-api.xml	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/sandbox/batch-execution-SPEC-jms2007/scripts/common/common-api.xml	2010-07-26 16:26:08 UTC (rev 34197)
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Copyright 2009 Red Hat, Inc.
+ Red Hat 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.
+  -->
+<!--
+   This file contains the low level api that should not be called
+   on the command line directly.
+-->
+
+<project name="RedHat-JBoss-Performance:Common APC" default="usage" basedir=".">
+
+   <target name="check-and-wait" description="General purpose script to detect if a java process is running. Will sleep the configured amount.">
+      <delete file="${pid.output.file}"/>
+      <groovy>
+         import org.apache.commons.lang.StringUtils;
+         searchStr = "${properties['pid.process.name']}"
+         check =  {jpsOutput -> tokenisedList = jpsOutput.tokenize()
+                     num = tokenisedList.count(searchStr)
+                     returnValue = (1 == num)
+                     return returnValue 
+                  }
+         
+         jpsOutput = "jps".execute().text
+         
+         while ( checkVal = check(jpsOutput))
+         {
+            println "The process [${properties['pid.process.name']}] is still running. Will wait ${properties['completion.wait.period.inMilliSeconds']} milli seconds."
+            Thread.sleep("${properties['completion.wait.period.inMilliSeconds']}".toBigInteger().intValue())
+            jpsOutput = "jps".execute().text
+         }
+      </groovy>
+   </target>
+   
+</project>
\ No newline at end of file



More information about the jboss-svn-commits mailing list