[jboss-svn-commits] JBL Code SVN: r31105 - labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Fri Jan 15 11:36:35 EST 2010


Author: whitingjr
Date: 2010-01-15 11:36:35 -0500 (Fri, 15 Jan 2010)
New Revision: 31105

Added:
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/average-results.xsl
   labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/merge-thread-results.xsl
Log:
Added stylesheets to merge and calculate average values.


Added: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/average-results.xsl
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/average-results.xsl	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/average-results.xsl	2010-01-15 16:36:35 UTC (rev 31105)
@@ -0,0 +1,78 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+   <xsl:param name="hibernate">org.hibernate</xsl:param>
+   <xsl:param name="arjuna">com.arjuna</xsl:param>
+   <xsl:param name="caveat-emptor">auction</xsl:param>
+   <xsl:param name="jboss">org.jboss</xsl:param>
+   <xsl:param name="log4j">org.apache.log4j</xsl:param>
+   <xsl:param name="db-vendor-package.A" />
+   <xsl:param name="db-vendor-package.B" />
+   
+   <xsl:template match="/">
+      <xsl:apply-templates select="/*"/>
+   </xsl:template>
+   <xsl:template match="analysis">
+      <xsl:copy>
+         <xsl:apply-templates/>
+      </xsl:copy>
+   </xsl:template>
+   <xsl:template match="summary-analysis">
+      <xsl:copy>
+         <xsl:apply-templates select="category-0|category-B|category-C|category-D"/>
+      </xsl:copy>
+   </xsl:template>
+   <xsl:template match="category-0|category-B|category-C|category-D">
+      <!-- context node: category-0|category-B|category-C|category-D -->
+      
+      <xsl:copy>
+         <xsl:apply-templates/>
+      </xsl:copy>
+   </xsl:template>
+   <xsl:template match="frame">
+      <!-- context node: frame -->
+         <xsl:element name="frame">
+            <xsl:copy-of select="@mn"/>
+            <xsl:element name="methodDuration">
+               <xsl:element name="average-gross">
+                  <xsl:value-of select="round(./methodDuration/gross div @count)"/>
+               </xsl:element>
+               <xsl:element name="average-net">
+                  <xsl:value-of select="round(./methodDuration/net div @count)"/>
+               </xsl:element>
+            </xsl:element>
+            <xsl:element name="{name(./*[name()!='methodDuration'])}">
+               <xsl:element name="{$hibernate}">
+                  <xsl:value-of select="round(./*[name()!='methodDuration']/org.hibernate div @count)"></xsl:value-of>
+               </xsl:element>
+               <xsl:element name="{$arjuna}">
+                  <xsl:value-of select="round(./*[name()!='methodDuration']/com.arjuna div @count)"></xsl:value-of>
+               </xsl:element>
+               <xsl:element name="{$caveat-emptor}">
+                  <xsl:value-of select="round(./*[name()!='methodDuration']/auction div @count)"></xsl:value-of>
+               </xsl:element>
+               <xsl:element name="{$jboss}">
+                  <xsl:value-of select="round(./*[name()!='methodDuration']/org.jboss div @count)"></xsl:value-of>
+               </xsl:element>
+               <xsl:element name="{$log4j}">
+                  <xsl:value-of select="round(./*[name()!='methodDuration']/org.apache.log4j div @count)"></xsl:value-of>
+               </xsl:element>
+               <xsl:choose>
+                  <xsl:when test="'${db-vendor-package.xpath.A}' = '${db-vendor-package.xpath.B}'">
+                     <xsl:element name="${db-vendor-package.xpath.A}">
+                        <xsl:value-of select="round(./*[name()!='methodDuration']/*[position()=last()] div @count)"/>
+                     </xsl:element>
+                  </xsl:when>
+                  <xsl:otherwise>
+                     <xsl:element name="${db-vendor-package.xpath.A}">
+                        <xsl:value-of select="round(./*[name()!='methodDuration']/${db-vendor-package.xpath.A} div @count)"/>
+                     </xsl:element>
+                     <xsl:element name="${db-vendor-package.xpath.B}">
+                        <xsl:value-of select="round(./*[name()!='methodDuration']/${db-vendor-package.xpath.B} div @count)"/>
+                     </xsl:element>
+                  </xsl:otherwise>
+               </xsl:choose>
+            </xsl:element>
+         </xsl:element>
+   </xsl:template>
+   
+</xsl:stylesheet>

Added: labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/merge-thread-results.xsl
===================================================================
--- labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/merge-thread-results.xsl	                        (rev 0)
+++ labs/jbosstm/workspace/whitingjr/trunk/performance/src/main/resources/xsl/merge-thread-results.xsl	2010-01-15 16:36:35 UTC (rev 31105)
@@ -0,0 +1,117 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
+   <!-- This stylesheet merges the results of multi-threaded calls. -->
+   <xsl:param name="hibernate">org.hibernate</xsl:param>
+   <xsl:param name="arjuna">com.arjuna</xsl:param>
+   <xsl:param name="caveat-emptor">auction</xsl:param>
+   <xsl:param name="jboss">org.jboss</xsl:param>
+   <xsl:param name="log4j">org.apache.log4j</xsl:param>
+   <xsl:param name="db-vendor-package.A" />
+   <xsl:param name="db-vendor-package.B" />
+
+   <xsl:template match="/">
+      <xsl:apply-templates select="/*" />
+   </xsl:template>
+   <xsl:template match="analysis">
+      <xsl:copy>
+         <xsl:apply-templates />
+      </xsl:copy>
+   </xsl:template>
+   <xsl:template match="summary-analysis">
+      <xsl:copy>
+         <xsl:apply-templates select="category-0" />
+         <xsl:copy-of select="./category-A" />
+         <xsl:apply-templates select="category-B" />
+         <xsl:apply-templates select="category-C" />
+         <xsl:apply-templates select="category-D" />
+      </xsl:copy>
+
+   </xsl:template>
+
+   <xsl:template match="category-0|category-B|category-C|category-D">
+      <!--
+         Context node: /analysis/summary-analysis/category-0 or category-B or
+         category-C or category-D
+      -->
+      <xsl:copy>
+         <xsl:apply-templates select="frame"/>
+      </xsl:copy>
+   </xsl:template>
+
+   <xsl:template match="frame">
+      <!-- Context node: /analysis/summary-analysis/*/frame -->
+      <!-- Need to reduce the number of frame nodes that have the same method name @mn
+      attribute. -->
+      <xsl:variable name="methodName" select="./@mn"/>
+      
+      <xsl:if test="0 = count(preceding::frame[@mn=$methodName])">
+         <!-- Use the first node with a distinct @mn attribute value.
+         Want to merge multiple source tree 'frame's with identical @mn to one
+         in result tree. -->
+            <xsl:element name="frame">
+               <xsl:attribute name="mn">
+                     <xsl:value-of select="@mn" />
+                  </xsl:attribute>
+               <xsl:attribute name="count">
+                     <!-- Assuming the reduction of counts is valid because each
+                     thread will be following a deterministic path. The @c count
+                     will be identical for each thread. -->
+                  <xsl:value-of select="count(../frame[@mn=$methodName]) * @c" />
+               </xsl:attribute>
+               <xsl:element name="methodDuration">
+                  <xsl:element name="gross">
+                     <xsl:value-of select="sum(../frame[@mn=$methodName]/methodDuration/gross) " />
+                  </xsl:element>
+                  <xsl:element name="net">
+                     <xsl:value-of select="sum(../frame[@mn=$methodName]/methodDuration/net) " />
+                  </xsl:element>
+               </xsl:element>
+
+               <xsl:element name="{name(./*['methodDuration' != name()])}">
+                  <xsl:element name="{$hibernate}">
+                     <xsl:value-of
+                        select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/org.hibernate) " />
+                  </xsl:element>
+                  <xsl:element name="{$arjuna}">
+                     <xsl:value-of
+                        select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/com.arjuna) " />
+                  </xsl:element>
+                  <xsl:element name="{$caveat-emptor}">
+                     <xsl:value-of
+                        select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/auction) " />
+                  </xsl:element>
+                  <xsl:element name="{$jboss}">
+                     <xsl:value-of
+                        select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/org.jboss) " />
+                  </xsl:element>
+                  <xsl:element name="{$log4j}">
+                     <xsl:value-of
+                        select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/org.apache.log4j) " />
+                  </xsl:element>
+                  <xsl:choose>
+                     <xsl:when
+                        test="'${db-vendor-package.xpath.A}' = '${db-vendor-package.xpath.B}'">
+                        <xsl:element name="${db-vendor-package.xpath.A}">
+                           <xsl:value-of
+                              select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/${db-vendor-package.xpath.A} ) " />
+                        </xsl:element>
+                     </xsl:when>
+                     <xsl:otherwise>
+                        <xsl:element name="${db-vendor-package.xpath.A}">
+                           <xsl:value-of
+                              select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/${db-vendor-package.xpath.A} ) " />
+                        </xsl:element>
+                        <xsl:element name="${db-vendor-package.xpath.B}">
+                           <xsl:value-of
+                              select="sum(../frame[@mn=$methodName]/*['methodDuration' != name()]/${db-vendor-package.xpath.B} ) " />
+                        </xsl:element>
+                     </xsl:otherwise>
+                  </xsl:choose>
+               </xsl:element>
+            </xsl:element>
+      </xsl:if>
+      
+      
+   </xsl:template>
+
+</xsl:stylesheet>
\ No newline at end of file



More information about the jboss-svn-commits mailing list