[jboss-svn-commits] JBL Code SVN: r29667 - in labs/jbosstm/workspace/whitingjr/trunk/performance: lib and 3 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Oct 19 10:41:44 EDT 2009


Author: whitingjr
Date: 2009-10-19 10:41:44 -0400 (Mon, 19 Oct 2009)
New Revision: 29667

Added:
   labs/jbosstm/workspace/whitingjr/trunk/performance/lib/client.jar
   labs/jbosstm/workspace/whitingjr/trunk/performance/lib/profile.jar
Modified:
   labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml
   labs/jbosstm/workspace/whitingjr/trunk/performance/pom.xml
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile-ant-demo.properties
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/java/org/jboss/tm/performance/TestDemo.java
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/resources/testsuite-integration-demo.xml
Log:
Added configuration for interactive profiling mode.
Now uses API to control propfiling application tied into the TestNG before and after annotations.

Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml	2009-10-19 14:17:22 UTC (rev 29666)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/build.xml	2009-10-19 14:41:44 UTC (rev 29667)
@@ -28,6 +28,8 @@
 	<path id="demo.compile.classpath">
       <path refid="project.classpath" />
       <pathelement path="/home/whitingjr/.m2/repository/log4j/log4j/1.2.15/log4j-1.2.15.jar" />
+		<pathelement path="lib/profile.jar" />
+		<pathelement path="lib/client.jar" />
    </path>
 	
 	<path id="demo.run.classpath">
@@ -119,7 +121,7 @@
 		<javac srcdir="src/test/java" destdir="${build.classes.dir}" classpathref="demo.run.classpath" />
 	</target>
 
-	<target name="call-profile-demo" depends="compile-demo">
+	<target name="call-profile-demo" depends="compile-demo" description="depreciated task - do not use">
 		<!--java classname="org.apache.tools.ant.launch.Launcher" fork="yes">
 			<jvmarg value="-javaagent:${JIP_HOME}/profile/profile.jar" />
 			<jvmarg value="-Dprofile.properties=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/src/main/resources/profile-ant-demo.properties" />
@@ -137,8 +139,8 @@
 		<mkdir dir="${test.output.dir}"/>
 
 		<testng outputDir="${test.output.dir}">
-			<jvmarg value="-javaagent:${JIP_HOME}/profile/profile.jar" />
-         <jvmarg value="-Dprofile.properties=/home/whitingjr/eclipse/v3.5-galileo/workspaces/performance/performance/src/main/resources/profile-ant-demo.properties" />
+			<jvmarg value="-javaagent:lib/profile.jar" />
+         <jvmarg value="-Dprofile.properties=src/main/resources/profile-ant-demo.properties" />
          <classpath>
 				<path refid="demo.test.classpath" />
 			</classpath>

Added: labs/jbosstm/workspace/whitingjr/trunk/performance/lib/client.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/whitingjr/trunk/performance/lib/client.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: labs/jbosstm/workspace/whitingjr/trunk/performance/lib/profile.jar
===================================================================
(Binary files differ)


Property changes on: labs/jbosstm/workspace/whitingjr/trunk/performance/lib/profile.jar
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/pom.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/pom.xml	2009-10-19 14:17:22 UTC (rev 29666)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/pom.xml	2009-10-19 14:41:44 UTC (rev 29667)
@@ -18,11 +18,21 @@
 			<version>5.10</version>
 			<classifier>jdk15</classifier>
 		</dependency>
-      <dependency>
-         <groupId>org.hibernate</groupId>
-         <artifactId>caveatemptor-jpa</artifactId>
-         <version>1.0</version>
-      </dependency>
+		<dependency>
+			<groupId>org.hibernate</groupId>
+			<artifactId>caveatemptor-jpa</artifactId>
+			<version>1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.mentorgen.tools.profile</groupId>
+			<artifactId>jip</artifactId>
+			<version>1.0</version>
+		</dependency>
+		<dependency>
+			<groupId>com.mentorgen.tools.profile</groupId>
+			<artifactId>jip-client</artifactId>
+			<version>1.0</version>
+		</dependency>
 
 	</dependencies>
 	<build>

Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile-ant-demo.properties
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile-ant-demo.properties	2009-10-19 14:17:22 UTC (rev 29666)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/profile-ant-demo.properties	2009-10-19 14:41:44 UTC (rev 29667)
@@ -3,13 +3,13 @@
 # (on | off)
 # default = on
 #
-profiler=on
+profiler=off
 #
 # Can the profiler be controlled remotely ?
 # (on | off)
 # default = off
 #
-remote=off
+remote=on
 #
 # TCP listen port for remote control
 # default =15599
@@ -18,7 +18,6 @@
 #
 #
 ClassLoaderFilter.1=com.mentorgen.tools.profile.instrument.clfilter.StandardClassLoaderFilter
-ClassLoaderFilter.2=com.mentorgen.tools.profile.instrument.clfilter.AntTaskClassLoaderFilter
 #accept-class-loaders=sun.misc.Launcher$AppClassLoader
 #
 # What is the maximum depth for thread dumps
@@ -72,4 +71,4 @@
 #profiler-class=net.sourceforge.jiprof.timeline.TimeLineProfiler
 #clock-resolution=ms
 
-debug=on
\ No newline at end of file
+debug=off
\ No newline at end of file

Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/java/org/jboss/tm/performance/TestDemo.java
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/java/org/jboss/tm/performance/TestDemo.java	2009-10-19 14:17:22 UTC (rev 29666)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/java/org/jboss/tm/performance/TestDemo.java	2009-10-19 14:41:44 UTC (rev 29667)
@@ -24,41 +24,76 @@
 
 import org.apache.log4j.Logger;
 import org.jboss.application.Demo;
-import org.testng.annotations.BeforeTest;
+import org.testng.annotations.AfterGroups;
+import org.testng.annotations.BeforeGroups;
 import org.testng.annotations.Parameters;
 import org.testng.annotations.Test;
 
+import com.mentorgen.tools.profile.runtime.Profile;
+
 public class TestDemo
 {
    private static final Logger logger = Logger.getLogger(TestDemo.class);
-   private String repeatCount;
+   private String warmupCount;
+   private String profileRepeatCount;
 
-   public String getRepeatCount()
+   public String getWarmupCount()
    {
-      return repeatCount;
+      return warmupCount;
    }
 
-   public void setRepeatCount(String repeatCount)
+   public void setWarmupCount(String warmupCount)
    {
-      this.repeatCount = repeatCount;
+      this.warmupCount = warmupCount;
    }
 
+   public String getProfileRepeatCount()
+   {
+      return profileRepeatCount;
+   }
+
+   public void setProfileRepeatCount(String profileRepeatCount)
+   {
+      this.profileRepeatCount = profileRepeatCount;
+   }
+   
    @Test (groups="demo.tests")
-   public void runWarmUp() throws Exception
+   public void runProfiledApplication() throws Exception
    {
       Demo application = new Demo();
-      int repeat = Integer.valueOf(getRepeatCount()).intValue();
-      logger.info("The application will be executed ["+repeat+"] times.");
+      int repeat = Integer.valueOf(getWarmupCount()).intValue();
+      logger.info("The application will be profiled by executing ["+repeat+"] times.");
       for (int count =0; count < repeat ; count = count + 1)
       {
          application.main(new String[]{});
       }
    }
    
-   @BeforeTest (groups = "demo.tests")
-   @Parameters ({"repeat_test"})
-   public void setUp(String repeatCount)
+   @BeforeGroups (groups = "demo.tests")
+   @Parameters ({"warmup_repeat_count", "profile_repeat_count"})
+   public void setUp(String warmupCount, String profileCount)
    {
-      this.setRepeatCount(repeatCount);
+      Demo application = new Demo();
+      this.setWarmupCount(warmupCount);
+      this.setProfileRepeatCount(profileCount);
+      
+      /* Warm up the application */
+      int repeat = Integer.valueOf(getWarmupCount()).intValue();
+      logger.info("The application will be warmed up by executing ["+repeat+"] times.");
+      for (int count =0; count < repeat ; count = count + 1)
+      {
+         application.main(new String[]{});
+      }
+      /* The application has been warmed up and the compiler should have completed compilation. 
+       * Now start the JIP profiler. */
+      Profile.clear();
+      Profile.start();
    }
+   
+   @AfterGroups (groups="demo.tests")
+   public void stopProfiling()
+   {
+      Profile.stop();
+      Profile.shutdown();
+   }
 }

Modified: labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/resources/testsuite-integration-demo.xml
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/resources/testsuite-integration-demo.xml	2009-10-19 14:17:22 UTC (rev 29666)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/test/resources/testsuite-integration-demo.xml	2009-10-19 14:41:44 UTC (rev 29667)
@@ -2,7 +2,8 @@
 
 <suite name="Demo-application-tests-report" verbose="2">
 
-    <parameter name="repeat_test" value="1"/>
+    <parameter name="warmup_repeat_count" value="10"/>
+    <parameter name="profile_repeat_count" value="2"/>
     
     <test name="Demo tests">
         <groups>



More information about the jboss-svn-commits mailing list