pauldick 02/04/04 08:11:57
Modified: test/java/src/org/apache/qetest/xsl PerfTestlet.java
Log:
Updated metrics. See comments.
Revision Changes Path
1.4 +41 -15 xml-xalan/test/java/src/org/apache/qetest/xsl/PerfTestlet.java
Index: PerfTestlet.java
===================================================================
RCS file: /home/cvs/xml-xalan/test/java/src/org/apache/qetest/xsl/PerfTestlet.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- PerfTestlet.java 2 Apr 2002 17:41:41 -0000 1.3
+++ PerfTestlet.java 4 Apr 2002 16:11:57 -0000 1.4
@@ -77,7 +77,7 @@
* transformWrapper will return different sets of timings.
*
* @author [EMAIL PROTECTED]
- * @version $Id: PerfTestlet.java,v 1.3 2002/04/02 17:41:41 pauldick Exp $
+ * @version $Id: PerfTestlet.java,v 1.4 2002/04/04 16:11:57 pauldick Exp $
*/
public class PerfTestlet extends StylesheetTestlet
{
@@ -130,12 +130,13 @@
// Setup: store various XalanC-like timing data in convenience variables
long warmup = 0L; // First transform. Used to
load classes.
long singletransform = 0L; // Very first Preload end-to-end transform
- long etoe = 0L; // First end-to-end transform during iterations
- long avgetoe = 0L; // Average of end-to-end transforms during iterations
- long parsexsl = 0L; // First stylesheet preprocess during iterations
- long avgparsexsl = 0L; // Average of stylesheet preprocess during
iterations
- long unparsedxml = 0L; // First stylesheet process during iterations
- long avgunparsedxml = 0L;// Average of stylesheet process during iterations
+ long etoe = 0L; // First end-to-end transform during iterations
+ long avgetoe = 0L; // Average of end-to-end transforms during
iterations
+ long parsexsl = 0L; // First stylesheet preprocess during
iterations
+ long avgparsexsl = 0L; // Average of stylesheet preprocess during
iterations
+ long unparsedxml = 0L; // First stylesheet process during iterations
+ long transxml = 0L; // Transform w/Stylesheet - NO OUTPUT
+ long transxmloutput = 0L; // Transform w/Stylesheet - OUTPUT
//logger.logMsg(Logger.TRACEMSG, "executing with: inputName=" +
datalet.inputName
// + " xmlName=" + datalet.xmlName + " outputName=" +
datalet.outputName
@@ -175,10 +176,16 @@
avgparsexsl += times[TransformWrapper.IDX_OVERALL];
logMemory(runtimeGC, false);
- // Measure(avgunparsedxml): average process
+ // Measure(avgunparsedxml): getTransformer + xmlRead + transform
times = transformWrapper.transformWithStylesheet(datalet.xmlName,
datalet.outputName);
- avgunparsedxml += times[TransformWrapper.IDX_OVERALL];
+ transxml += times[TransformWrapper.IDX_TRANSFORM];
logMemory(runtimeGC, false);
+
+ // Measure(avgunparsedxml): getTransformer + xmlRead + transform +
resultWrite
+ times = transformWrapper.transformWithStylesheet(datalet.xmlName,
datalet.outputName);
+ transxmloutput += times[TransformWrapper.IDX_OVERALL];
+ logMemory(runtimeGC, false);
+
}
// Measure(etoe): once: first full process
@@ -226,7 +233,7 @@
attrs.put("parsexsl", new Long(parsexsl)); // First stylesheet preprocess
during iterations
attrs.put("avgparsexsl", new Long(avgparsexsl / iterations)); // Average of
stylesheet preprocess during iterations
attrs.put("unparsedxml", new Long(unparsedxml)); // First stylesheet
process during iterations
- attrs.put("avgunparsedxml", new Long(avgunparsedxml / iterations)); //
Average of stylesheet process during iterations
+ attrs.put("transxml", new Long(transxml / iterations)); // Average of
stylesheet process during iterations
// Additional metrics for data throughput
File fIn = new File(datalet.inputName);
@@ -242,14 +249,33 @@
attrs.put("BytesOut", new Long(btOut));
fOutStrm.close();
- // Calculate thruput as Kb/sec. This is based on DataPower code.
- double thruPut = (double)(1000 * (btIn + btOut)) / (double)(1024 * 2 *
avgunparsedxml);
+ // I've added additional measurments. DP calculated KBs as
((Ki+Ko)/2)/sec.
+ // I now calculate it with the following (Ki+K0)/sec
+ // Calculate TRANSFORM thruput (Kb/sec). Based on DataPower; does NOT
file I/O
+ double KBtdp = (double)(1000 * (btIn + btOut)) / (double)(1024 * 2 *
transxml);
DecimalFormat fmt = new DecimalFormat("####.##");
- StringBuffer x = new StringBuffer( fmt.format(thruPut));
- attrs.put("KBs", x);
+ StringBuffer x = new StringBuffer( fmt.format(KBtdp));
+ attrs.put("KBtdp", x);
+
+ // Calculate OVERALL thruput (Kb/sec). Based on DataPower; does
include file I/O
+ double KBtsdp = (double)(1000 * (btIn + btOut)) / (double)(1024 * 2 *
transxmloutput);
+ //DecimalFormat fmt = new DecimalFormat("####.##");
+ x = new StringBuffer(fmt.format(KBtsdp));
+ attrs.put("KBtsdp", x);
+
+ // Calculate TRANSFORM thruput (Kb/sec). Based on ped; does NOT file
I/O
+ double KBtPD = (double)(1000 * (btIn + btOut)) / (double)(1024 *
transxml);
+ //DecimalFormat fmt = new DecimalFormat("####.##");
+ x = new StringBuffer(fmt.format(KBtPD));
+ attrs.put("KBtPD", x);
+
+ // Calculate OVERALL thruput (Kb/sec). Based on ped; does include file
I/O
+ double KBtsPD = (double)(1000 * (btIn + btOut)) / (double)(1024 *
transxmloutput);
+ //DecimalFormat fmt = new DecimalFormat("####.##");
+ x = new StringBuffer(fmt.format(KBtsPD));
+ attrs.put("KBtsPD", x);
- //logger.logElement(Logger.STATUSMSG, "perf", attrs, "PItr;");
logger.logElement(Logger.STATUSMSG, "perf", attrs, fIn.getName());
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]