Converting average response times to a summable node-set

ggusernameu8

New Member
I've been running a series of webservice tests in JMeter, and what I'd like to do is take the total sum of the average response times returned by each test. I have a way to find the average response times for each test, but no way to add the averages from the tests together. I am aware that in order to use XPath's sum() function the values need to be a part of a node-set, but from what I understand once I find the average values out of the XML they are no longer part of one. So I need to use the node-set() function, but I am fairly new to XSLT/XPath and am unsure how to get things working. Any help with this is appreciated!This is a sample XML from JMeter running with two iterations:\[code\]<?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>\[/code\]This is an exerpt in my XSLT where the averages from each test are found.\[code\]<xsl:for-each select="/testResults/*[not(@lb = preceding::*/@lb)]"> ... <xsl:variable name="count" select="count(../*[@lb = current()/@lb])" /> <xsl:variable name="totalTime" select="sum(../*[@lb = current()/@lb]/@t)" /> <xsl:variable name="averageTime" select="$totalTime div $count" /> ...</xsl:for-each>\[/code\]How can I enter these average times into a node-set and subsequently sum them?Here is an example of what the final reports look like for those interestedThanks in advance!
 
Back
Top