You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Havard Blok <hr...@google.com> on 2012/01/26 16:17:28 UTC

Reading back XML sample result data

To track the latency of multiple requests forming one single transaction
(inside runTest()), we'd like to use sub-results. Thus, JMeter is started
with -Jjmeter.save.saveservice.subresults=true and
-Jjmeter.save.saveservice.output_format=xml. This saves the results in an
XML file, which we'd like to read to store the values in our internal load
test result DB.

I can load the SampleResults objects back fine with the following line.
However, the loadElement() method is marked with "Used by Test code", which
mights suggest that it should not be relied on?

TestResultWrapper results =
  (TestResultWrapper)
org.apache.jmeter.save.SaveService.loadElement(inputStream);


Furthermore, using the SaveService class within another application is
slightly inconvenient, since it depends on the properties file
".../bin/saveservice.properties". This file is loaded inside a global
static block (a common patterned throughout the JMeter code).
JMeterUtils.setJMeterHome() can be used to set the base directory, but the
code in our internal data application would start to look ugly...

Is there another sanctioned way to read back the XML results file?
Duplicating the functionality within SaveService will not buy us much,
since the saveservice.properties file contains the xml to class mappings.

Or should we ignore the SampleResultConverter / SaveService completely, and
just write our own XML loader and parser. That would be a bit of a shame,
since the line above is all that is needed.

Have anybody else worked with this?

Regards,
Havard


-- 
--->Google Switzerland GmbH Identifikationsnummer: CH-020.4.028.116-1<----

Re: Reading back XML sample result data

Posted by apc <ap...@apc.kg>.
I did in JP@GC command-line tool. And I had to rely on launching my code in
Jmeter-like environment.
Yes, using Jmeter's saveservice is quire inconvinient. I use ResultCollector
class, it relies on SaveService, but it is more common for loading JTL
files.

-----
--
Andrey Pohilko
JP@GC Maintainer
--
View this message in context: http://jmeter.512774.n5.nabble.com/Reading-back-XML-sample-result-data-tp5433113p5433253.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@jmeter.apache.org
For additional commands, e-mail: user-help@jmeter.apache.org