jmeter-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From milam...@apache.org
Subject svn commit: r1302305 - in /jmeter/trunk/extras: build.xml collapse.jpg collapse.png expand.jpg expand.png jmeter-results-detail-report.xsl jmeter-results-detail-report_21.xsl jmeter-results-report.xsl jmeter-results-report_21.xsl
Date Mon, 19 Mar 2012 07:20:54 GMT
Author: milamber
Date: Mon Mar 19 07:20:54 2012
New Revision: 1302305

URL: http://svn.apache.org/viewvc?rev=1302305&view=rev
Log:
Bug 52941 - Improvements of HTML report design generated by JMeter Ant task extra

Added:
    jmeter/trunk/extras/collapse.png   (with props)
    jmeter/trunk/extras/expand.png   (with props)
Removed:
    jmeter/trunk/extras/collapse.jpg
    jmeter/trunk/extras/expand.jpg
Modified:
    jmeter/trunk/extras/build.xml
    jmeter/trunk/extras/jmeter-results-detail-report.xsl
    jmeter/trunk/extras/jmeter-results-detail-report_21.xsl
    jmeter/trunk/extras/jmeter-results-report.xsl
    jmeter/trunk/extras/jmeter-results-report_21.xsl

Modified: jmeter/trunk/extras/build.xml
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/build.xml?rev=1302305&r1=1302304&r2=1302305&view=diff
==============================================================================
--- jmeter/trunk/extras/build.xml (original)
+++ jmeter/trunk/extras/build.xml Mon Mar 19 07:20:54 2012
@@ -37,6 +37,7 @@
 		-Dtestpath=xyz - path to test file(s) (default user.dir).
 		                 N.B. Ant interprets relative paths against the build file
 		-Djmeter.home=.. - path to JMeter home directory (defaults to parent of this build file)
+        -Dreport.title="My Report" - title for html report (default is 'Load Test Results')
 
 		Deprecated:
 		-Dformat=2.0 - use version 2.0 JTL files rather than 2.1
@@ -45,6 +46,7 @@
 	
 	<property name="testpath" value="${user.dir}"/>
 	<property name="jmeter.home" value="${basedir}/.."/>
+	<property name="report.title" value="Load Test Results"/>
 		
 	<!-- Name of test (without .jmx) -->
 	<property name="test" value="Test"/>
@@ -116,7 +118,12 @@
         <fileset dir="${lib.dir}" includes="serializer*.jar"/>
     </path>
 
-	<target name="report" depends="_message_xalan">
+    <target name="report" depends="xslt-report,copy-images">
+        <echo>Report generated at ${report.datestamp}</echo>
+    </target>
+
+	<target name="xslt-report" depends="_message_xalan">
+		<tstamp><format property="report.datestamp" pattern="yyyy/MM/dd HH:mm"/></tstamp>
 		<xslt
 			classpathref="xslt.classpath"
 			force="true"
@@ -124,9 +131,23 @@
 		    out="${testpath}/${test}.html"
 		    style="${basedir}/jmeter-results-detail-report${style_version}.xsl">
 			<param name="showData" expression="${show-data}"/>
+			<param name="titleReport" expression="${report.title}"/>
+			<param name="dateReport" expression="${report.datestamp}"/>
 		</xslt>
 	</target>
 
+    <!-- Copy report images if needed -->
+    <target name="copy-images" depends="verify-images" unless="samepath">
+        <copy file="${basedir}/expand.png" tofile="${testpath}/expand.png"/>
+        <copy file="${basedir}/collapse.png" tofile="${testpath}/collapse.png"/>
+    </target>
+
+    <target name="verify-images">
+        <condition property="samepath">
+                <equals arg1="${testpath}" arg2="${basedir}" />
+        </condition>
+    </target>
+
 	<!-- Check that the xalan libraries are present -->
 	<condition property="xalan.present">
 	  	<and>

Added: jmeter/trunk/extras/collapse.png
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/collapse.png?rev=1302305&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/extras/collapse.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Added: jmeter/trunk/extras/expand.png
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/expand.png?rev=1302305&view=auto
==============================================================================
Binary file - no diff available.

Propchange: jmeter/trunk/extras/expand.png
------------------------------------------------------------------------------
    svn:mime-type = image/png

Modified: jmeter/trunk/extras/jmeter-results-detail-report.xsl
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/jmeter-results-detail-report.xsl?rev=1302305&r1=1302304&r2=1302305&view=diff
==============================================================================
--- jmeter/trunk/extras/jmeter-results-detail-report.xsl (original)
+++ jmeter/trunk/extras/jmeter-results-detail-report.xsl Mon Mar 19 07:20:54 2012
@@ -1,5 +1,5 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<xsl:output method="html" indent="yes" encoding="US-ASCII" doctype-public="-//W3C//DTD
HTML 4.01 Transitional//EN" />
+<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN" />
 
 
 <!--
@@ -102,12 +102,12 @@
 			   {
 			      if(document.getElementById(details_id+"_image").src.match("expand"))
 			      {
-			         document.getElementById(details_id+"_image").src = "collapse.jpg";
+			         document.getElementById(details_id+"_image").src = "collapse.png";
 			         expand(details_id);
 			      }
 			      else
 			      {
-			         document.getElementById(details_id+"_image").src = "expand.jpg";
+			         document.getElementById(details_id+"_image").src = "expand.png";
 			         collapse(details_id);
 			      } 
                            }
@@ -134,7 +134,7 @@
 	<table width="100%">
 		<tr>
 			<td align="left"></td>
-			<td align="right">Designed for use with <a href="http://jakarta.apache.org/jmeter">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
+			<td align="right">Designed for use with <a href="http://jmeter.apache.org/">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
 		</tr>
 	</table>
 	<hr size="1" />
@@ -279,7 +279,7 @@
 				<td align="center">
 				   <a href="">
 				      <xsl:attribute name="href"><xsl:text/>javascript:change('page_details_<xsl:value-of
select="position()" />')</xsl:attribute>
-				      <img src="expand.jpg" alt="expand/collapse"><xsl:attribute name="id"><xsl:text/>page_details_<xsl:value-of
select="position()" />_image</xsl:attribute></img>				      
+				      <img src="expand.png" alt="expand/collapse"><xsl:attribute name="id"><xsl:text/>page_details_<xsl:value-of
select="position()" />_image</xsl:attribute></img>				      
 				   </a>
 				</td>
 			</tr>

Modified: jmeter/trunk/extras/jmeter-results-detail-report_21.xsl
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/jmeter-results-detail-report_21.xsl?rev=1302305&r1=1302304&r2=1302305&view=diff
==============================================================================
--- jmeter/trunk/extras/jmeter-results-detail-report_21.xsl (original)
+++ jmeter/trunk/extras/jmeter-results-detail-report_21.xsl Mon Mar 19 07:20:54 2012
@@ -25,15 +25,17 @@
 	and you can then view the JTL in a browser
 -->
 
-<xsl:output method="html" indent="yes" encoding="US-ASCII" doctype-public="-//W3C//DTD
HTML 4.01 Transitional//EN" />
+<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN" />
 
 <!-- Defined parameters (overrideable) -->
 <xsl:param    name="showData" select="'n'"/>
+<xsl:param    name="titleReport" select="'Load Test Results'"/>
+<xsl:param    name="dateReport" select="'date not defined'"/>
 
 <xsl:template match="testResults">
 	<html>
 		<head>
-			<title>Load Test Results</title>
+			<title><xsl:value-of select="$titleReport" /></title>
 			<style type="text/css">
 				body {
 					font:normal 68% verdana,arial,helvetica;
@@ -43,9 +45,10 @@
 					font-size: 68%;
 				}
 				table.details tr th{
+				    color: #ffffff;
 					font-weight: bold;
-					text-align:left;
-					background:#a6caf0;
+					text-align:center;
+					background:#2674a6;
 					white-space: nowrap;
 				}
 				table.details tr td{
@@ -110,12 +113,12 @@
 			   {
 			      if(document.getElementById(details_id+"_image").src.match("expand"))
 			      {
-			         document.getElementById(details_id+"_image").src = "collapse.jpg";
+			         document.getElementById(details_id+"_image").src = "collapse.png";
 			         expand(details_id);
 			      }
 			      else
 			      {
-			         document.getElementById(details_id+"_image").src = "expand.jpg";
+			         document.getElementById(details_id+"_image").src = "expand.png";
 			         collapse(details_id);
 			      } 
                            }
@@ -126,10 +129,10 @@
 			<xsl:call-template name="pageHeader" />
 			
 			<xsl:call-template name="summary" />
-			<hr size="1" width="95%" align="left" />
+			<hr size="1" width="95%" align="center" />
 			
 			<xsl:call-template name="pagelist" />
-			<hr size="1" width="95%" align="left" />
+			<hr size="1" width="95%" align="center" />
 			
 			<xsl:call-template name="detail" />
 
@@ -138,11 +141,11 @@
 </xsl:template>
 
 <xsl:template name="pageHeader">
-	<h1>Load Test Results</h1>
+	<h1><xsl:value-of select="$titleReport" /></h1>
 	<table width="100%">
 		<tr>
-			<td align="left"></td>
-			<td align="right">Designed for use with <a href="http://jakarta.apache.org/jmeter">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
+			<td align="left">Date report: <xsl:value-of select="$dateReport" /></td>
+			<td align="right">Designed for use with <a href="http://jmeter.apache.org/">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
 		</tr>
 	</table>
 	<hr size="1" />
@@ -150,9 +153,9 @@
 
 <xsl:template name="summary">
 	<h2>Summary</h2>
-	<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+	<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 		<tr valign="top">
-			<th>Tests</th>
+			<th># Samples</th>
 			<th>Failures</th>
 			<th>Success Rate</th>
 			<th>Average Time</th>
@@ -181,28 +184,28 @@
 					<xsl:when test="$allFailureCount &gt; 0">Failure</xsl:when>
 				</xsl:choose>
 			</xsl:attribute>
-			<td>
+			<td align="center">
 				<xsl:value-of select="$allCount" />
 			</td>
-			<td>
+			<td align="center">
 				<xsl:value-of select="$allFailureCount" />
 			</td>
-			<td>
+			<td align="center">
 				<xsl:call-template name="display-percent">
 					<xsl:with-param name="value" select="$allSuccessPercent" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="center">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allAverageTime" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="center">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allMinTime" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="center">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allMaxTime" />
 				</xsl:call-template>
@@ -213,10 +216,10 @@
 
 <xsl:template name="pagelist">
 	<h2>Pages</h2>
-	<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+	<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 		<tr valign="top">
 			<th>URL</th>
-			<th>Tests</th>
+			<th># Samples</th>
 			<th>Failures</th>
 			<th>Success Rate</th>
 			<th>Average Time</th>
@@ -258,28 +261,28 @@
 				  <xsl:value-of select="$label" />
 				</xsl:if>
 				</td>
-				<td>
+				<td align="center">
 					<xsl:value-of select="$count" />
 				</td>
-				<td>
+				<td align="center">
 					<xsl:value-of select="$failureCount" />
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-percent">
 						<xsl:with-param name="value" select="$successPercent" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$averageTime" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$minTime" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$maxTime" />
 					</xsl:call-template>
@@ -287,7 +290,7 @@
 				<td align="center">
 				   <a href="">
 				      <xsl:attribute name="href"><xsl:text/>javascript:change('page_details_<xsl:value-of
select="position()" />')</xsl:attribute>
-				      <img src="expand.jpg" alt="expand/collapse"><xsl:attribute name="id"><xsl:text/>page_details_<xsl:value-of
select="position()" />_image</xsl:attribute></img>				      
+				      <img src="expand.png" alt="expand/collapse"><xsl:attribute name="id"><xsl:text/>page_details_<xsl:value-of
select="position()" />_image</xsl:attribute></img>				      
 				   </a>
 				</td>
 			</tr>
@@ -297,7 +300,7 @@
                            <td colspan="8" bgcolor="#FF0000">
                               <div align="center">
 			         <b>Details for Page "<xsl:value-of select="$label" />"</b>
-			         <table bordercolor="#000000" border="1"  cellpadding="0" cellspacing="0" width="95%">
+			         <table bordercolor="#000000" bgcolor="#2674A6" border="0"  cellpadding="1"
cellspacing="1" width="95%">
 			         <tr>
 			            <th>Thread</th>
 			            <th>Iteration</th>
@@ -309,7 +312,7 @@
 			         <xsl:for-each select="../*[@lb = $label and @tn != $label]">			       
 			            
 			            <tr>
 			               <td><xsl:value-of select="@tn" /></td>
-			               <td><xsl:value-of select="position()" /></td>
+			               <td align="center"><xsl:value-of select="position()" /></td>
 			               <td align="right"><xsl:value-of select="@t" /></td>
 			               <!--  TODO allow for missing bytes field -->
 			               <td align="right"><xsl:value-of select="@by" /></td>
@@ -339,7 +342,7 @@
 			<xsl:if test="$failureCount > 0">
 				<h3><xsl:value-of select="@lb" /><a><xsl:attribute name="name"><xsl:value-of
select="@lb" /></xsl:attribute></a></h3>
 
-				<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+				<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 				<tr valign="top">
 					<th>Response</th>
 					<th>Failure Message</th>

Modified: jmeter/trunk/extras/jmeter-results-report.xsl
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/jmeter-results-report.xsl?rev=1302305&r1=1302304&r2=1302305&view=diff
==============================================================================
--- jmeter/trunk/extras/jmeter-results-report.xsl (original)
+++ jmeter/trunk/extras/jmeter-results-report.xsl Mon Mar 19 07:20:54 2012
@@ -1,5 +1,5 @@
 <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
-<xsl:output method="html" indent="yes" encoding="US-ASCII" doctype-public="-//W3C//DTD
HTML 4.01 Transitional//EN" />
+<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN" />
 
 
 <!--
@@ -76,7 +76,7 @@
 	<table width="100%">
 		<tr>
 			<td align="left"></td>
-			<td align="right">Designed for use with <a href="http://jakarta.apache.org/jmeter">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
+			<td align="right">Designed for use with <a href="http://jmeter.apache.org/">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
 		</tr>
 	</table>
 	<hr size="1" />

Modified: jmeter/trunk/extras/jmeter-results-report_21.xsl
URL: http://svn.apache.org/viewvc/jmeter/trunk/extras/jmeter-results-report_21.xsl?rev=1302305&r1=1302304&r2=1302305&view=diff
==============================================================================
--- jmeter/trunk/extras/jmeter-results-report_21.xsl (original)
+++ jmeter/trunk/extras/jmeter-results-report_21.xsl Mon Mar 19 07:20:54 2012
@@ -25,12 +25,15 @@
 	and you can then view the JTL in a browser
 -->
 	
-<xsl:output method="html" indent="yes" encoding="US-ASCII" doctype-public="-//W3C//DTD
HTML 4.01 Transitional//EN" />
+<xsl:output method="html" indent="yes" encoding="UTF-8" doctype-public="-//W3C//DTD HTML
4.01 Transitional//EN" />
+
+<xsl:param name="titleReport" select="'Load Test Results'"/>
+<xsl:param name="dateReport" select="'date not defined'"/>
 
 <xsl:template match="testResults">
 	<html>
 		<head>
-			<title>Load Test Results</title>
+			<title><xsl:value-of select="$titleReport" /></title>
 			<style type="text/css">
 				body {
 					font:normal 68% verdana,arial,helvetica;
@@ -40,9 +43,10 @@
 					font-size: 68%;
 				}
 				table.details tr th{
+				    color: #ffffff;
 					font-weight: bold;
-					text-align:left;
-					background:#a6caf0;
+					text-align:center;
+					background:#2674a6;
 					white-space: nowrap;
 				}
 				table.details tr td{
@@ -68,10 +72,10 @@
 			<xsl:call-template name="pageHeader" />
 			
 			<xsl:call-template name="summary" />
-			<hr size="1" width="95%" align="left" />
+			<hr size="1" width="95%" align="center" />
 			
 			<xsl:call-template name="pagelist" />
-			<hr size="1" width="95%" align="left" />
+			<hr size="1" width="95%" align="center" />
 			
 			<xsl:call-template name="detail" />
 
@@ -80,11 +84,11 @@
 </xsl:template>
 
 <xsl:template name="pageHeader">
-	<h1>Load Test Results</h1>
+	<h1><xsl:value-of select="$titleReport" /></h1>
 	<table width="100%">
 		<tr>
-			<td align="left"></td>
-			<td align="right">Designed for use with <a href="http://jakarta.apache.org/jmeter">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
+			<td align="left">Date report: <xsl:value-of select="$dateReport" /></td>
+			<td align="right">Designed for use with <a href="http://jmeter.apache.org/">JMeter</a>
and <a href="http://ant.apache.org">Ant</a>.</td>
 		</tr>
 	</table>
 	<hr size="1" />
@@ -92,9 +96,9 @@
 
 <xsl:template name="summary">
 	<h2>Summary</h2>
-	<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+	<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 		<tr valign="top">
-			<th>Tests</th>
+			<th># Samples</th>
 			<th>Failures</th>
 			<th>Success Rate</th>
 			<th>Average Time</th>
@@ -123,28 +127,28 @@
 					<xsl:when test="$allFailureCount &gt; 0">Failure</xsl:when>
 				</xsl:choose>
 			</xsl:attribute>
-			<td>
+			<td align="center">
 				<xsl:value-of select="$allCount" />
 			</td>
-			<td>
+			<td align="center">
 				<xsl:value-of select="$allFailureCount" />
 			</td>
-			<td>
+			<td align="right">
 				<xsl:call-template name="display-percent">
 					<xsl:with-param name="value" select="$allSuccessPercent" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="right">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allAverageTime" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="right">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allMinTime" />
 				</xsl:call-template>
 			</td>
-			<td>
+			<td align="right">
 				<xsl:call-template name="display-time">
 					<xsl:with-param name="value" select="$allMaxTime" />
 				</xsl:call-template>
@@ -155,10 +159,10 @@
 
 <xsl:template name="pagelist">
 	<h2>Pages</h2>
-	<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+	<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 		<tr valign="top">
 			<th>URL</th>
-			<th>Tests</th>
+			<th># Samples</th>
 			<th>Failures</th>
 			<th>Success Rate</th>
 			<th>Average Time</th>
@@ -192,28 +196,28 @@
 				<td>
 					<xsl:value-of select="$label" />
 				</td>
-				<td>
+				<td align="center">
 					<xsl:value-of select="$count" />
 				</td>
-				<td>
+				<td align="center">
 					<xsl:value-of select="$failureCount" />
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-percent">
 						<xsl:with-param name="value" select="$successPercent" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$averageTime" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$minTime" />
 					</xsl:call-template>
 				</td>
-				<td>
+				<td align="right">
 					<xsl:call-template name="display-time">
 						<xsl:with-param name="value" select="$maxTime" />
 					</xsl:call-template>
@@ -236,7 +240,7 @@
 			<xsl:if test="$failureCount > 0">
 				<h3><xsl:value-of select="@lb" /></h3>
 
-				<table class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
+				<table align="center" class="details" border="0" cellpadding="5" cellspacing="2" width="95%">
 				<tr valign="top">
 					<th>Response</th>
 					<th>Failure Message</th>



Mime
View raw message