Author: jsong
Date: Mon Feb 14 16:21:37 2005
New Revision: 153875
URL: http://svn.apache.org/viewcvs?view=rev&rev=153875
Log:
Contributed by Jamie Zyskowski: modify/improve logging to allow for trend
plotting, update controls report
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/dproxy/StrlenDProxyTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javabean/StrlenBeanTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javaclass/StrlenClassTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/methodinv/StrlenMethodInvTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenPgmTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenSTPgmTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarargsPgmTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarretPgmTest.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/StandAlonePerfRunner.java
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/WebPerfRunner.java
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varargs/Controller.jpf
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varret/Controller.jpf
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/src/graphing/SeriesProducer.java
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/jpf/controls.jsp
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/dproxy/StrlenDProxyTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/dproxy/StrlenDProxyTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/dproxy/StrlenDProxyTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/dproxy/StrlenDProxyTest.java
Mon Feb 14 16:21:37 2005
@@ -47,7 +47,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenDProxyTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
}
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javabean/StrlenBeanTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javabean/StrlenBeanTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javabean/StrlenBeanTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javabean/StrlenBeanTest.java
Mon Feb 14 16:21:37 2005
@@ -43,7 +43,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenBeanTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
}
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javaclass/StrlenClassTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javaclass/StrlenClassTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javaclass/StrlenClassTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/javaclass/StrlenClassTest.java
Mon Feb 14 16:21:37 2005
@@ -44,7 +44,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenClassTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
}
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/methodinv/StrlenMethodInvTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/methodinv/StrlenMethodInvTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/methodinv/StrlenMethodInvTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/benchmarks/methodinv/StrlenMethodInvTest.java
Mon Feb 14 16:21:37 2005
@@ -42,7 +42,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenMethodInvTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
}
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenPgmTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenPgmTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenPgmTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenPgmTest.java
Mon Feb 14 16:21:37 2005
@@ -43,7 +43,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenPgmTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenSTPgmTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenSTPgmTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenSTPgmTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/StrlenSTPgmTest.java
Mon Feb 14 16:21:37 2005
@@ -44,7 +44,7 @@
cputime = System.currentTimeMillis() - cputime;
// print the results
- System.out.print(Constants.DELIM+StrlenPgmTest.class.getName()+" ");
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
System.out.print("hash "+stringSum+" ");
System.out.println("time "+cputime);
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarargsPgmTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarargsPgmTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarargsPgmTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarargsPgmTest.java
Mon Feb 14 16:21:37 2005
@@ -31,7 +31,8 @@
int sum = 0;
long duration = 0;
cputime = 0;
- System.out.print(Constants.DELIM+VarargsPgmTest.class.getName()+" ");
+
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
for(int j=0; j<Constants.DEFAULT_VARARG_PARAMS.length; j++)
{
input = util.createIntArray(Constants.DEFAULT_VARARG_PARAMS[j]);
@@ -43,11 +44,14 @@
}
duration = System.currentTimeMillis() - duration;
- // print the results
- System.out.print("array_size"+j+"="+input.length+" ");
- System.out.print("expected_sum"+j+"="+expectedSum(input)+" ");
- System.out.print("actual_sum"+j+"="+sum+" ");
- System.out.print("duration"+j+"="+duration+" ");
+ // print the interim results
+ System.out.print("array_size"+j+":"+input.length+" ");
+ System.out.print("expected_sum"+j+":"+expectedSum(input)+" ");
+ System.out.print("actual_sum"+j+":"+sum+" ");
+ System.out.print("duration"+j+":"+duration+" ");
+ // The below uses the = sign so it can be plotted as a custom
+ // datapoint in reportWeb
+ System.out.print(input.length+"="+duration+" ");
// update the overall result
hash += sum;
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarretPgmTest.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarretPgmTest.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarretPgmTest.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/standalone/VarretPgmTest.java
Mon Feb 14 16:21:37 2005
@@ -31,7 +31,8 @@
long duration = 0;
int length = 0;
cputime = 0;
- System.out.print(Constants.DELIM+VarretPgmTest.class.getName()+" ");
+
+ System.out.print(Constants.DELIM+test.getClass().getSimpleName()+" ");
for(int j=0; j<Constants.DEFAULT_VARRET_PARAMS.length; j++)
{
length = 0;
@@ -43,10 +44,14 @@
duration = System.currentTimeMillis() - duration;
// print the results
- System.out.print("input"+j+"="+input[j]+" ");
- System.out.print("length_sum"+j+"="+length+" ");
- System.out.print("duration"+j+"="+duration+" ");
+ System.out.print("input"+j+":"+input[j]+" ");
+ System.out.print("length_sum"+j+":"+length+" ");
+ System.out.print("duration"+j+":"+duration+" ");
+ // The below uses the = sign so it can be plotted as a custom
+ // datapoint in reportWeb
+ System.out.print(input[j]+"="+duration+" ");
+
// update the overall result
hash += length;
cputime += duration;
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/StandAlonePerfRunner.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/StandAlonePerfRunner.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/StandAlonePerfRunner.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/StandAlonePerfRunner.java
Mon Feb 14 16:21:37 2005
@@ -1,177 +1,173 @@
package org.apache.beehive.controls.perf.tch;
-import java.lang.InterruptedException;
-import java.lang.Math;
import java.io.IOException;
import java.util.StringTokenizer;
-import org.apache.beehive.test.tools.tch.task.TaskContext;
+import org.apache.beehive.controls.perf.utils.StreamCapture;
import org.apache.beehive.test.tools.tch.core.test.AbstractTestLogicTask;
import org.apache.beehive.test.tools.tch.core.test.ResultHandler;
import
org.apache.beehive.test.tools.tch.extension.exectask.common.ResultLogger;
-
-import org.apache.beehive.controls.perf.utils.StreamCapture;
-import org.apache.beehive.controls.perf.utils.Constants;
+import org.apache.beehive.test.tools.tch.task.TaskContext;
/**
* @author [EMAIL PROTECTED]
*/
public class StandAlonePerfRunner extends AbstractTestLogicTask
{
- private String _sTestname = null;
- private String _sCmdline = null;
- private int _iHash;
- private float _fBar;
- private float _fDrift;
- private long _lTimeout;
-
- private ResultLogger _logger;
-
- public StandAlonePerfRunner(ResultHandler inResultHandler)
- {
- super("StandAlonePerfRunner",inResultHandler);
- }
-
- public void init(String p_sTestname,
- String p_sCmdline,
- int p_iHash,
- float p_fBar,
- float p_fDrift,
- long p_lTimeout)
- {
- // set private members
- this._sTestname = p_sTestname;
- this._sCmdline = p_sCmdline;
- this._iHash = p_iHash;
- this._fBar = p_fBar;
- this._fDrift = p_fDrift;
- this._lTimeout = p_lTimeout;
- this._logger = this.getResultLogger();
- }
-
- public TaskContext run(TaskContext in)
- {
- //float fActualTime = -1;
- long lActualTime = -1;
- //float fActualMemory = -1;
- long lActualMemory = -1;
- float fActualDrift = -1;
- int iActualHash = -1;
-
- // run the commandline
- try{
- Process p = Runtime.getRuntime().exec(_sCmdline);
- StreamCapture scStdErr = new StreamCapture(p.getErrorStream(), "STDERR");
- StreamCapture scStdOut = new StreamCapture(p.getInputStream(), "STDOUT");
- scStdErr.start();
- scStdOut.start();
- int iReturn = p.waitFor();
- // wait up to the given timeout
- scStdErr.join(_lTimeout);
- scStdOut.join(_lTimeout);
-
- // grab the test result from stdout
- StringTokenizer st = new StringTokenizer(scStdOut.getString()," ");
- while(st.hasMoreTokens())
- {
- String sCurrent = st.nextToken();
-
- if(sCurrent.indexOf("time") == 0 && sCurrent.length() ==
"time".length())
- {
- lActualTime = Long.parseLong(st.nextToken().trim());
- }
- if(sCurrent.indexOf("memory") == 0 && sCurrent.length() ==
"memory".length())
- {
- lActualMemory = Long.parseLong(st.nextToken().trim());
- }
- else if(sCurrent.indexOf("hash") == 0 && sCurrent.length() ==
"hash".length())
- {
- iActualHash = Integer.parseInt(st.nextToken().trim());
- }
- }
-
- // calculate the drift for time (or memory if time isn't given)
- if(-1 != lActualTime)
- {
- fActualDrift = ((lActualTime - _fBar)/_fBar);
- }
- else if(-1 != lActualMemory)
- {
- fActualDrift = ((lActualMemory - _fBar)/_fBar);
- }
-
-
- // log the test result
- String perfResultFormat = "\n"+Constants.DELIM+_sTestname+" hash
"+iActualHash+" ";
- _logger.inform("----------");
- _logger.inform("allowed hash="+_iHash);
- _logger.inform("actual hash="+iActualHash);
- _logger.inform("----------");
-
- if(-1 != lActualTime && -1 != lActualMemory)
- {
- _logger.inform("allowed time="+_fBar);
- _logger.inform("actual time="+lActualTime);
- _logger.inform("actual memory="+lActualMemory);
- _logger.inform("----------");
- perfResultFormat += "time "+lActualTime+" memory "+lActualMemory;
- }
- else if(-1 != lActualMemory && -1 == lActualTime)
- {
- _logger.inform("allowed memory="+_fBar);
- _logger.inform("actual memory="+lActualMemory);
- _logger.inform("----------");
- perfResultFormat += " memory "+lActualMemory;
- }
- else if(-1 != lActualTime)
- {
- _logger.inform("allowed time="+_fBar);
- _logger.inform("actual time="+lActualTime);
- _logger.inform("----------");
- perfResultFormat += "time "+lActualTime;
- }
- else
- {
- _logger.inform("ERROR: neither time nor memory are set");
- _logger.inform("----------");
- }
-
- _logger.inform("allowed drift (abs)="+_fDrift);
- _logger.inform("actual drift="+fActualDrift);
- _logger.inform("----------");
- _logger.inform(perfResultFormat);
-
- // evaluate the result
- if(iActualHash != _iHash)
- {
- _logger.failure("HASH ERROR");
- _logger.inform("command line output:\n"+scStdOut.getString());
- _logger.inform("command line srderr:\n"+scStdErr.getString());
- }
- else if(Math.abs(fActualDrift) > _fDrift)
- {
- if(fActualDrift < 0){
- _logger.failure("PERF IMPROVED - QA NEEDS TO RESET THE BAR");
- }
- else{
- _logger.failure("PERF REGRESSION BEYOND ALLOWED DRIFT");
- }
- }
- else{
- _logger.success("PASS");
- }
- }
- catch(InterruptedException ie){
- _logger.failure("exceeded timeout");
- ie.printStackTrace();
- return null;
- }
- catch(IOException ioe){
- _logger.failure("process exec threw IOException");
- ioe.printStackTrace();
- return null;
- }
- return null;
- }
-
+ static final long serialVersionUID = -1;
+ private String _sTestname = null;
+ private String _sCmdline = null;
+ private int _iHash;
+ private float _fBar;
+ private float _fDrift;
+ private long _lTimeout;
+
+ private ResultLogger _logger;
+
+ public StandAlonePerfRunner(ResultHandler inResultHandler)
+ {
+ super("StandAlonePerfRunner",inResultHandler);
+ }
+
+ public void init(String p_sTestname,
+ String p_sCmdline,
+ int p_iHash,
+ float p_fBar,
+ float p_fDrift,
+ long p_lTimeout)
+ {
+ // set private members
+ this._sTestname = p_sTestname;
+ this._sCmdline = p_sCmdline;
+ this._iHash = p_iHash;
+ this._fBar = p_fBar;
+ this._fDrift = p_fDrift;
+ this._lTimeout = p_lTimeout;
+ this._logger = this.getResultLogger();
+ }
+
+ public TaskContext run(TaskContext in)
+ {
+ //float fActualTime = -1;
+ long lActualTime = -1;
+ //float fActualMemory = -1;
+ long lActualMemory = -1;
+ float fActualDrift = -1;
+ int iActualHash = -1;
+
+ // run the commandline
+ try{
+ Process p = Runtime.getRuntime().exec(_sCmdline);
+ StreamCapture scStdErr = new
StreamCapture(p.getErrorStream(), "STDERR");
+ StreamCapture scStdOut = new
StreamCapture(p.getInputStream(), "STDOUT");
+ scStdErr.start();
+ scStdOut.start();
+ int iReturn = p.waitFor();
+ // wait up to the given timeout
+ scStdErr.join(_lTimeout);
+ scStdOut.join(_lTimeout);
+
+ // grab the test result from stdout
+ StringTokenizer st = new
StringTokenizer(scStdOut.getString()," ");
+ while(st.hasMoreTokens())
+ {
+ String sCurrent = st.nextToken();
+
+ if(sCurrent.indexOf("time") == 0 &&
sCurrent.length() == "time".length())
+ {
+ lActualTime =
Long.parseLong(st.nextToken().trim());
+ }
+ if(sCurrent.indexOf("memory") == 0 &&
sCurrent.length() == "memory".length())
+ {
+ lActualMemory =
Long.parseLong(st.nextToken().trim());
+ }
+ else if(sCurrent.indexOf("hash") == 0 &&
sCurrent.length() == "hash".length())
+ {
+ iActualHash =
Integer.parseInt(st.nextToken().trim());
+ }
+ }
+
+ // calculate the drift for time (or memory if time
isn't given)
+ if(-1 != lActualTime)
+ {
+ fActualDrift = ((lActualTime - _fBar)/_fBar);
+ }
+ else if(-1 != lActualMemory)
+ {
+ fActualDrift = ((lActualMemory - _fBar)/_fBar);
+ }
+
+
+ // log the test result
+ _logger.inform("----------");
+ _logger.inform("allowed hash="+_iHash);
+ _logger.inform("actual hash="+iActualHash);
+ _logger.inform("----------");
+
+ if(-1 != lActualTime && -1 != lActualMemory)
+ {
+ _logger.inform("allowed time="+_fBar);
+ _logger.inform("actual time="+lActualTime);
+ _logger.inform("actual memory="+lActualMemory);
+ _logger.inform("----------");
+ }
+ else if(-1 != lActualMemory && -1 == lActualTime)
+ {
+ _logger.inform("allowed memory="+_fBar);
+ _logger.inform("actual memory="+lActualMemory);
+ _logger.inform("----------");
+ }
+ else if(-1 != lActualTime)
+ {
+ _logger.inform("allowed time="+_fBar);
+ _logger.inform("actual time="+lActualTime);
+ _logger.inform("----------");
+ }
+ else
+ {
+ _logger.inform("ERROR: neither time nor memory
are set");
+ _logger.inform("----------");
+ }
+
+ _logger.inform("allowed drift (abs)="+_fDrift);
+ _logger.inform("actual drift="+fActualDrift);
+ _logger.inform("----------");
+ // The below log statement passes stdout into
+ // the tch logs such that the log file can be
+ // post-processed into a perf-result.xsd instance
+ _logger.inform("\n"+scStdOut.getString());
+
+ // evaluate the result
+ if(iActualHash != _iHash)
+ {
+ _logger.failure("HASH ERROR");
+ _logger.inform("command line
output:\n"+scStdOut.getString());
+ _logger.inform("command line
srderr:\n"+scStdErr.getString());
+ }
+ else if(Math.abs(fActualDrift) > _fDrift)
+ {
+ if(fActualDrift < 0){
+ _logger.failure("PERF IMPROVED - QA
NEEDS TO RESET THE BAR");
+ }
+ else{
+ _logger.failure("PERF REGRESSION BEYOND
ALLOWED DRIFT");
+ }
+ }
+ else{
+ _logger.success("PASS");
+ }
+ }
+ catch(InterruptedException ie){
+ _logger.failure("exceeded timeout");
+ ie.printStackTrace();
+ return null;
+ }
+ catch(IOException ioe){
+ _logger.failure("process exec threw IOException");
+ ioe.printStackTrace();
+ return null;
+ }
+ return null;
+ }
+
}
Modified:
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/WebPerfRunner.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/WebPerfRunner.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/WebPerfRunner.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/src/org/apache/beehive/controls/perf/tch/WebPerfRunner.java
Mon Feb 14 16:21:37 2005
@@ -23,6 +23,7 @@
*/
public class WebPerfRunner extends AbstractTestLogicTask
{
+ static final long serialVersionUID = -1;
private String _sTestname = null;
private String _sUrl = null;
private int _iHash;
@@ -140,7 +141,7 @@
if (null != exception && ! exception.equals(""))
_logger.failure("FAIL - Exception: " + exception);
- // grab the test result from stdout
+ // grab the test result from the result message
StringTokenizer st = new StringTokenizer(message," ");
while(st.hasMoreTokens()){
String sCurrent = st.nextToken();
@@ -171,7 +172,6 @@
// log the test result
- String perfResultFormat = "\n"+Constants.DELIM+_sTestname+" hash
"+iActualHash+" ";
_logger.inform("----------");
_logger.inform("allowed hash="+_iHash);
_logger.inform("actual hash="+iActualHash);
@@ -183,21 +183,18 @@
_logger.inform("actual time="+lActualTime);
_logger.inform("actual memory="+lActualMemory);
_logger.inform("----------");
- perfResultFormat += "time "+lActualTime+" memory "+lActualMemory;
}
else if(-1 != lActualMemory && -1 == lActualTime)
{
_logger.inform("allowed memory="+_fBar);
_logger.inform("actual memory="+lActualMemory);
_logger.inform("----------");
- perfResultFormat += " memory "+lActualMemory;
}
else if(-1 != lActualTime)
{
_logger.inform("allowed time="+_fBar);
_logger.inform("actual time="+lActualTime);
_logger.inform("----------");
- perfResultFormat += "time "+lActualTime;
}
else
{
@@ -208,7 +205,11 @@
_logger.inform("allowed drift (abs)="+_fDrift);
_logger.inform("actual drift="+fActualDrift);
_logger.inform("----------");
- _logger.inform(perfResultFormat);
+ // The below log statement passes stdout into
+ // the tch logs such that the log file can be
+ // post-processed into a perf-result.xsd instance
+ String perfResultFormat = message.replace("[(","").replace(")]","");
+ _logger.inform("\n"+perfResultFormat.trim());
// evaluate the result
if(iActualHash != _iHash)
Modified:
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varargs/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varargs/Controller.jpf?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varargs/Controller.jpf
(original)
+++
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varargs/Controller.jpf
Mon Feb 14 16:21:37 2005
@@ -83,10 +83,14 @@
duration = System.currentTimeMillis() -
duration;
// log the results for this input
- log("array_size"+j+"="+input.length);
- log("expected_sum"+j+"="+expectedSum(input));
- log("actual_sum"+j+"="+sum);
- log("duration"+j+"="+duration+" ");
+ log("array_size"+j+":"+input.length);
+ log("expected_sum"+j+":"+expectedSum(input));
+ log("actual_sum"+j+":"+sum);
+ log("duration"+j+":"+duration+" ");
+
+ // The below uses the = sign so it can be plotted
as a custom
+ // datapoint in reportWeb
+ log(input.length+"="+duration+" ");
// update the overall result
hash += sum;
Modified:
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varret/Controller.jpf
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varret/Controller.jpf?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varret/Controller.jpf
(original)
+++
incubator/beehive/trunk/controls/test/perf/webapps/controlsPerfWeb/jpf/test/controls/performance/programmatic/varret/Controller.jpf
Mon Feb 14 16:21:37 2005
@@ -81,9 +81,13 @@
duration = System.currentTimeMillis() -
duration;
// log the results for this input
- log("int_input"+j+"="+input[j]);
- log("length_sum"+j+"="+length);
- log("duration"+j+"="+duration+" ");
+ log("int_input"+j+":"+input[j]);
+ log("length_sum"+j+":"+length);
+ log("duration"+j+":"+duration+" ");
+
+ // The below uses the = sign so it can be plotted
as a custom
+ // datapoint in reportWeb
+ log(input[j]+"="+duration+" ");
// update the overall result
hash += length;
Modified:
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/src/graphing/SeriesProducer.java
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/src/graphing/SeriesProducer.java?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/src/graphing/SeriesProducer.java
(original)
+++
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/WEB-INF/src/graphing/SeriesProducer.java
Mon Feb 14 16:21:37 2005
@@ -32,11 +32,14 @@
String k_xaxis = "xaxis";
String k_yaxis = "yaxis";
String k_regexMap = "regexmap";
+ String k_customSeries = "customSeries";
// retreive the param values
String filename = (String)params.get(k_filename);
String xaxis = (String)params.get(k_xaxis);
String yaxis = (String)params.get(k_yaxis);
HashMap<String,String> regexBySeriesName =
(HashMap<String,String>)params.get(k_regexMap);
+ Boolean customSeries = (Boolean)params.get(k_customSeries);
+ if(null == customSeries)customSeries = false;
// get the series params
System.out.println(LOGDELIM+"filename="+filename);
@@ -76,7 +79,7 @@
System.out.println(LOGDELIM+"name="+name);
System.out.println(LOGDELIM+"regex="+regex);
HashMap<Long,String> seriesResultIds =
getFullnamesById(regex,resultset);
- dataset.addSeries(getXYSeriesDataset(name,
seriesResultIds,xaxis,yaxis,resultset));
+ dataset.addSeries(getXYSeriesDataset(name,
seriesResultIds,xaxis,yaxis,resultset,customSeries));
}
return (Dataset)dataset;
@@ -93,7 +96,7 @@
////////////
// utilities
////////////
- private XYSeries getXYSeriesDataset(String p_seriesName,
HashMap<Long,String> p_resultIds, String p_xvalue, String p_yvalue,
ResultSetDocument.ResultSet p_resultset)
+ private XYSeries getXYSeriesDataset(String p_seriesName,
HashMap<Long,String> p_resultIds, String p_xvalue, String p_yvalue,
ResultSetDocument.ResultSet p_resultset,Boolean p_customSeries)
{
XYSeries xyseries = new XYSeries(p_seriesName);
Result[] results = p_resultset.getResultArray();
@@ -102,7 +105,19 @@
if(p_resultIds.containsKey(results[i].getId()))
{
String name =
p_resultIds.get(results[i].getId());
- if(p_yvalue.equalsIgnoreCase("time") &&
results[i].isSetTime())
+ if(p_customSeries)
+ {
+ System.out.println(LOGDELIM+"custom
param series specified");
+ //System.out.println(LOGDELIM+"current
result:\n"+results[i]);
+ Custom[] customs =
results[i].getCustomArray();
+ for(int j=0; j<customs.length; j++)
+ {
+ Number xvalue =
Integer.parseInt(customs[j].getName());
+ Number yvalue =
Integer.parseInt(customs[j].getValue());
+ xyseries.add( xvalue,yvalue);
+ }
+ }
+ else if(p_yvalue.equalsIgnoreCase("time") &&
results[i].isSetTime())
{
System.out.println(LOGDELIM+"adding
y-axis time data for: "+name);
Float xvalue =
Float.parseFloat(getCustomValue(p_xvalue,results[i]));
Modified:
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/jpf/controls.jsp
URL:
http://svn.apache.org/viewcvs/incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/jpf/controls.jsp?view=diff&r1=153874&r2=153875
==============================================================================
---
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/jpf/controls.jsp
(original)
+++
incubator/beehive/trunk/controls/test/perf/webapps/reportWeb/jpf/controls.jsp
Mon Feb 14 16:21:37 2005
@@ -1,4 +1,7 @@
<%@ page language="java" contentType="text/html;charset=UTF-8"%>
+
+<[EMAIL PROTECTED] import="java.util.HashMap"%>
+
<%@ taglib uri="http://beehive.apache.org/netui/tags-databinding-1.0"
prefix="netui-data"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-html-1.0" prefix="netui"%>
<%@ taglib uri="http://beehive.apache.org/netui/tags-template-1.0"
prefix="netui-template"%>
@@ -7,9 +10,8 @@
<!-- global strings -->
<%
String g_sMemory = "memory";
-String g_sSize = "size";
-String g_sFlavor = "flavor";
String g_sTime = "time";
+Boolean customSeries = false;
%>
<netui:html>
@@ -51,47 +53,54 @@
<cewolf:img chartid="StrlenPgm" renderer="/cewolf" width="800"
height="800"/>
<P>
-
- <% String VarargsPgm = ".*VarargsPgm.*"; %>
- <jsp:useBean id="varargspgm_data" class="graphing.SnapshotProducer"/>
+ <%
+ HashMap<String,String> VarargsPgmSeries = new
HashMap<String,String>();
+
VarargsPgmSeries.put("VarargsPgmStandalone",".*VarargsPgmTest.*");
+ VarargsPgmSeries.put("VarargsPgmJpf",".*VarargsPgmJpfTest.*");
+ customSeries = true;
+ %>
+ <jsp:useBean id="VarargsPgmSeries_data"
class="graphing.SeriesProducer"/>
<cewolf:chart
- id="VarargsPgm"
- title="Variable Arguments Custom Control"
- type="verticalbar"
- showlegend="false"
- xaxislabel="scneario"
+ id="VarargsPgmSeries"
+ title="Custom Control Performance vs. Number of Arguments"
+ type="xy"
+ xaxislabel="size of int[] arg"
yaxislabel="time(ms)">
<cewolf:data>
- <cewolf:producer id="varargspgm_data">
- <cewolf:param name="filename"
value="${requestScope.filename}" />
- <cewolf:param name="regex" value="<%=VarargsPgm%>" />
+ <cewolf:producer id="VarargsPgmSeries_data">
+ <cewolf:param name="filename"
value='${requestScope.filename}' />
+ <cewolf:param name="regexmap"
value="<%=VarargsPgmSeries%>"/>
+ <cewolf:param
name="customSeries" value="<%=customSeries%>"/>
</cewolf:producer>
</cewolf:data>
- <cewolf:chartpostprocessor id="verticalxlabel"/>
</cewolf:chart>
<p>
- <cewolf:img chartid="VarargsPgm" renderer="/cewolf" width="800"
height="800"/>
+ <cewolf:img chartid="VarargsPgmSeries" renderer="/cewolf"
width="800" height="800"/>
<P>
- <% String VarretPgm = ".*VarretPgm.*"; %>
- <jsp:useBean id="varretpgm_data" class="graphing.SnapshotProducer"/>
+ <%
+ HashMap<String,String> VarretPgmSeries = new
HashMap<String,String>();
+ VarretPgmSeries.put("VarretPgmStandalone",".*VarretPgmTest.*");
+ VarretPgmSeries.put("VarretPgmJpf",".*VarretPgmJpfTest.*");
+ customSeries = true;
+ %>
+ <jsp:useBean id="VarretPgmSeries_data"
class="graphing.SeriesProducer"/>
<cewolf:chart
- id="VarretPgm"
- title="Variable Return Value Size Custom Control"
- type="verticalbar"
- showlegend="false"
- xaxislabel="scneario"
+ id="VarretPgmSeries"
+ title="Custom Control Performance vs. Size of Returned
Object"
+ type="xy"
+ xaxislabel="size of int[] returned"
yaxislabel="time(ms)">
<cewolf:data>
- <cewolf:producer id="varretpgm_data">
- <cewolf:param name="filename"
value="${requestScope.filename}" />
- <cewolf:param name="regex" value="<%=VarretPgm%>" />
+ <cewolf:producer id="VarretPgmSeries_data">
+ <cewolf:param name="filename"
value='${requestScope.filename}' />
+ <cewolf:param name="regexmap"
value="<%=VarretPgmSeries%>"/>
+ <cewolf:param
name="customSeries" value="<%=customSeries%>"/>
</cewolf:producer>
</cewolf:data>
- <cewolf:chartpostprocessor id="verticalxlabel"/>
</cewolf:chart>
<p>
- <cewolf:img chartid="VarretPgm" renderer="/cewolf" width="800"
height="800"/>
+ <cewolf:img chartid="VarretPgmSeries" renderer="/cewolf"
width="800" height="800"/>
<P>
</netui:body>