jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jordi Buj" <>
Subject Re: Adding more data to sampleResults
Date Tue, 01 Mar 2005 12:45:23 GMT
Thanks Sebb for your answer, your suggestion is enough for my needs and
definitely better than having 2 samplers.
Just one question: if I put the script in a file then I don't seem to have
access to the ${time} variables.
Am I doing something wrong?


----- Original Message ----- 
From: "sebb" <>
To: "JMeter Users List" <>
Sent: Sunday, February 27, 2005 20:16
Subject: Re: Adding more data to sampleResults

> On Sat, 26 Feb 2005 23:05:05 +0100, Jordi Buj <>
> > Hi,
> > I'm a beginner with JMeter - it's great - thanks!
> > I want to test a J2EE application that contains performance data in
every response, basically the amount of time spent in the different layers
(web application, JCA connector and the EIS).
> > What I'd like to do ideally is to extract the data from the response and
have it included in the output file, something like:
> > <sampleResult threadName="..." ... time="300" eisTime="30" JCATime="80"
> >
> > I've read the manual, the articles and searched the mailing list, and my
"newbie" solution so far is to add a JavaRequest/JavaTest to each
HttpRequest to output the extra times. That doubles the sampleResults and is
more complex to process, but is about right for me
> > Just wanted to ask here if I could do it better as explained above.
> >
> > Any guess?
> As you have discovered, the only way currently to put data in the
> JMeter Test Log (.jtl) file is via sampler data.
> You can change the fields which are saved (by changing
>, but you cannot currently add extra output to the
> file.
> If the test is run in functional test mode, the JTL file will contain
> the entire response, including the J2EE performance data. The response
> data would have to be scanned for the information later, and the file
> could get rather large - but it would eliminate the extra samples...
> The only work-round I can think of is to amend the sample result so
> that the data you want is added to one of the fields that is currently
> available for output to the result file.
> One way to do this is to use the BeanShell Assertion:
> This has read/write access to the Failure flag and the Failure
> Message, neither of which are really suitable. It also has access to
> the Response object itself, which means it can be used to change any
> fields that the response object gives access to.
> For example:
> Response.setSampleLabel("eisTime=30 JCATime=80");
> The BSH Assertion could either extract the values directly from the
> ResponseData byte[] variable, or the script could make use of any
> JMeter variables set by previous Regex extractor(s), e.g.
> Response.setSampleLabel("eisTime=${EIST} JCATime=${JCAT}");
> where EIST and JCAT are JMeter variables with the appropriate contents.
> Not exactly an elegant solution, and you would have to parse the label
> text, but it does work...
> > *jordi
> >
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message