On Sat, 26 Feb 2005 23:05:05 +0100, Jordi Buj <[EMAIL PROTECTED]> wrote: > 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" > webappTime="100"/> > > 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 jmeter.properties), 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: http://jakarta.apache.org/jmeter/usermanual/component_reference.html#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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]

