Sebb wrote:
> One way to do this currently might be to include the
> variables in the sampler names. 

This would be too painful, as there are quite a few samplers to edit. It
would also be ugly, since I want to add several variables to each
sampler name.

I ended up using a BeanShell Assertion at the same level as the
samplers. This therefore works on all the samplers. The BeanShell code
looks like this:

Response.setSampleLabel(
        vars.get("testId") + "," +
        vars.get("testStartTimestamp") + "," +
        vars.get("sampleParameter") + "," +
        Response.getSampleLabel()
        );

Since I'm sticking commas in the sample name, this effectively inserts
new fields into the CSV file before the sample label field. This makes
post-processing of the file quite simple. (For my sins, I am doing
post-processing in Microsoft Excel.)

Bennett wrote:
> If not, I think this could be done by writing an enhanced version of
the
> Simple Data Writer Listener.

Actually this is much trickier than I thought... especially if you want
to make it work for XML output as well as CSV.

Bennett.
--
Bennett McElwee


-----Original Message-----
From: sebb [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, 15 February 2006 11:51 pm
To: JMeter Users List
Subject: Re: Add extra data to test output

One way to do this currently might be to include the variables in the
sampler names.

Alternatively, use a single additional sample to record the fixed
information, and post-process the CSV file using a scripting language
such as Perl.

Your approach of extending the Simple Data Writer sounds fine.

S.
On 14/02/06, Bennett McElwee <[EMAIL PROTECTED]> wrote:
> Is it possible to write arbitrary data to the results file? For each
> line of CSV data written, I would like to include extra fields of my
own
> devising. Essentially I want to be able to write the values of
arbitrary
> variables to the file.
>
> The reason I want to do this is so I can include things such as a Test
> Script ID and Test Run ID with every sample. This will make automated
> post-processing of results much, much simpler.
>
> Is there any way to do this without creating a new JMeter component?
>
> If not, I think this could be done by writing an enhanced version of
the
> Simple Data Writer Listener. When configuring this Listener, users
could
> specify any number of variable names; the writer would append the
values
> of those variables to each line of the CSV results, or add <variable>
> child elements to each <sampleResult> element in the XML file.
>
> Is this a reasonable approach?
>

This communication, including any attachments, is confidential. If you are not 
the intended recipient, you should not read it - please contact me immediately, 
destroy it, and do not copy or use any part of this communication or disclose 
anything about it. Thank you. Please note that this communication does not 
designate an information system for the purposes of the Electronic Transactions 
Act 2002.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to