How to work with only the first “X” siblings from an xml

Laptopj

New Member
I've been running a series of webservice tests in JMeter, and what I've been doing is modifying my results report to include the total sum of the average response times returned by each test. But what I also need to do is take the sum of the averages times up until a certain test. Is there a way I could modify the XSLT to sum the test averages for every test except test "X" and those after it? e.g. lb="getSubscribers"? Here is what the results report typically looks like. Essentially I want to sum the contents of the Average Time column from the "http" test, to the "AlarmMgmtWSDL" test.Here is my XML from JMeter:<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="http://stackoverflow.com/questions/style/jmeter-results-detail-report_21.xsl"?><testResults version="1.2"><httpSample t="78" lt="78" ts="1338826079163" s="true" lb="html" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="4418" ng="1" na="1"/><httpSample t="31" lt="31" ts="1338826079241" s="true" lb="userRoleRetriever" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="758" ng="1" na="1"/><httpSample t="32" lt="32" ts="1338826079272" s="true" lb="UserActivityWSDL" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="2398" ng="1" na="1"/><httpSample t="156" lt="125" ts="1338826079304" s="true" lb="SubscriberMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="56434" ng="1" na="1"/><httpSample t="31" lt="16" ts="1338826079460" s="true" lb="NetworkMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="33020" ng="1" na="1"/><httpSample t="15" lt="15" ts="1338826079507" s="true" lb="AlarmMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="11594" ng="1" na="1"/><httpSample t="141" lt="141" ts="1338826079538" s="true" lb="getSubscribers" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="397" ng="1" na="1"/><httpSample t="265" lt="234" ts="1338826079679" s="true" lb="getMpegResultsById" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="832927" ng="1" na="1"/><httpSample t="15" lt="15" ts="1338826079976" s="true" lb="getOverallSummary" rc="200" rm="OK" tn="vuserver 1-1" dt="text" by="402" ng="1" na="1"/><httpSample t="0" lt="0" ts="1338826082663" s="true" lb="html" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="4418" ng="1" na="1"/><httpSample t="16" lt="16" ts="1338826082663" s="true" lb="userRoleRetriever" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="758" ng="1" na="1"/><httpSample t="15" lt="0" ts="1338826082679" s="true" lb="UserActivityWSDL" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="2398" ng="1" na="1"/><httpSample t="32" lt="0" ts="1338826082694" s="true" lb="SubscriberMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="56434" ng="1" na="1"/><httpSample t="31" lt="15" ts="1338826082726" s="true" lb="NetworkMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="33020" ng="1" na="1"/><httpSample t="16" lt="16" ts="1338826082757" s="true" lb="AlarmMgmtWSDL" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="11594" ng="1" na="1"/><httpSample t="250" lt="250" ts="1338826082788" s="true" lb="getSubscribers" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="10536" ng="1" na="1"/><httpSample t="15454" lt="15392" ts="1338826083038" s="true" lb="getMpegResultsById" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="2023426" ng="1" na="1"/><httpSample t="15" lt="15" ts="1338826098555" s="true" lb="getOverallSummary" rc="200" rm="OK" tn="vuserver 1-2" dt="text" by="402" ng="1" na="1"/></testResults>I need to work with the first X number of test results from that XML, exclude the rest, and at the same time keep the X number of test results when they occur on he second iteration so I can take the averages.This is an excerpt from my xslt that finds the total sum of the test averages:<xsl:variable name="totalAverageTime"> <xsl:for-each-group select="httpSample" group-by="@lb"> <xsl:variable name="count" select="count(current-group())" /> <xsl:variable name="totalTime" select="sum(current-group()/@t)" /> <average avg="{$totalTime div $count}" /> </xsl:for-each-group></xsl:variable><tr> <td> <xsl:call-template name="display-time"> <xsl:with-param name="value" select="sum($totalAverageTime/average/@avg)" /> </xsl:call-template> </td></tr>Any ideas on how to work with these certain tests? Help would be greatly appreciated!
 
Back
Top