You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "Thomson, Alex" <AT...@ndsuk.com> on 2007/06/05 11:36:43 UTC

${__threadNum} function in HTTP POST

Hi,

I am trying to use the ${__threadNum} function to send different files
for each user in an HTTP POST, however it is very difficult to see what
file path was actually sent by JMeter.

e.g. 900 users, 0 ramp up & 1 loop. HTTP Request HttpClient POST with
file name = /path/example/file_${__threadNum}.txt

>From that I presume each user will send a separate file referenced by
the thread number.

I am duplicating the function call in the HTTP Request HttpClient Name
so that I can at least see the number returned by the function for each
sample. E.g. HTTP POST ${__threadNum}

Is there any way to log what file was actually sent with the POST? I
can't tell whether there is an issue with the system under test or the
jmeter configuration.

Regards,

Alex
This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.

Please consider the environment before printing this email.

NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
A company registered in England and Wales   Registered no. 3080780    VAT no. GB 603 8808 40-00


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


Re: ${__threadNum} function in HTTP POST

Posted by sebb <se...@gmail.com>.
On 05/06/07, Thomson, Alex <AT...@ndsuk.com> wrote:
> That really is the scenario I need to test i.e. 900 users concurrently
> at the same time. Is it better to introduce a timer before the thread
> group starts?

A timer won't help here.

The problem is that a loop count of 1 does not allow the test to reach
a steady state; any measurements will probably be very dependent on
startup overhead.

> Anyhow, the tree listener doesn't report the filename and doesn't report
> the data file content either. In the case of a POST the filename would
> be useful.

Fee free to file a Bugzilla enhancement...

> However the ${__log(/path/example/file_${__threadNum}.txt)} works
> perfectly thanks sebb. :-)

Good.

> Incidentally I may have found a bug. When I make a modification to a
> field in a test plan and click on save, the modification disappears
> unless I move the cursor to a different field before I click save.
> JMeter is running on RHEL ES4 with Sun JDK 1.5.11.

Others have reported similar problems. Not sure if it is a JMeter or Java bug.

> -----Original Message-----
> From: sebb [mailto:sebbaz@gmail.com]
> Sent: 05 June 2007 10:46
> To: JMeter Users List
> Subject: Re: ${__threadNum} function in HTTP POST
>
> On 05/06/07, Thomson, Alex <AT...@ndsuk.com> wrote:
> > Hi,
> >
> > I am trying to use the ${__threadNum} function to send different files
> > for each user in an HTTP POST, however it is very difficult to see
> what
> > file path was actually sent by JMeter.
> >
> > e.g. 900 users, 0 ramp up & 1 loop.
>
> That's a very high initial load; with 1 loop it's likely that startup
> overhead will be a large proportion of the sample times...
>
> > HTTP Request HttpClient POST with
> > file name = /path/example/file_${__threadNum}.txt
> >
> > From that I presume each user will send a separate file referenced by
> > the thread number.
>
> Yes.
>
> > I am duplicating the function call in the HTTP Request HttpClient Name
> > so that I can at least see the number returned by the function for
> each
> > sample. E.g. HTTP POST ${__threadNum}
>
> OK
>
> > Is there any way to log what file was actually sent with the POST? I
> > can't tell whether there is an issue with the system under test or the
> > jmeter configuration.
>
> Does the filename appear in the Tree View Listener?
> Try it with 2 or 3 threads, and remove for the main testing.
>
> You could use the __log function:
>
> ${__log(/path/example/file_${__threadNum}.txt)}
>
>
> > Regards,
> >
> > Alex
> > This email message and any attachments thereto are intended only for
> use by the addressee(s) named above, and may contain legally privileged
> and/or confidential information. If the reader of this message is not
> the intended recipient, or the employee or agent responsible to deliver
> it to the intended recipient, you are hereby notified that any
> dissemination, distribution or copying of this communication is strictly
> prohibited. If you have received this communication in error, please
> immediately notify the postmaster@nds.com and destroy the original
> message.
> >
> > Please consider the environment before printing this email.
> >
> > NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath
> Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
> > A company registered in England and Wales   Registered no. 3080780
> VAT no. GB 603 8808 40-00
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
> This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
>
> Please consider the environment before printing this email.
>
> NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
> A company registered in England and Wales   Registered no. 3080780    VAT no. GB 603 8808 40-00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


RE: ${__threadNum} function in HTTP POST

Posted by "Thomson, Alex" <AT...@ndsuk.com>.
That really is the scenario I need to test i.e. 900 users concurrently
at the same time. Is it better to introduce a timer before the thread
group starts?

Anyhow, the tree listener doesn't report the filename and doesn't report
the data file content either. In the case of a POST the filename would
be useful.

However the ${__log(/path/example/file_${__threadNum}.txt)} works
perfectly thanks sebb. :-)

Incidentally I may have found a bug. When I make a modification to a
field in a test plan and click on save, the modification disappears
unless I move the cursor to a different field before I click save.
JMeter is running on RHEL ES4 with Sun JDK 1.5.11.

-----Original Message-----
From: sebb [mailto:sebbaz@gmail.com] 
Sent: 05 June 2007 10:46
To: JMeter Users List
Subject: Re: ${__threadNum} function in HTTP POST

On 05/06/07, Thomson, Alex <AT...@ndsuk.com> wrote:
> Hi,
>
> I am trying to use the ${__threadNum} function to send different files
> for each user in an HTTP POST, however it is very difficult to see
what
> file path was actually sent by JMeter.
>
> e.g. 900 users, 0 ramp up & 1 loop.

That's a very high initial load; with 1 loop it's likely that startup
overhead will be a large proportion of the sample times...

> HTTP Request HttpClient POST with
> file name = /path/example/file_${__threadNum}.txt
>
> From that I presume each user will send a separate file referenced by
> the thread number.

Yes.

> I am duplicating the function call in the HTTP Request HttpClient Name
> so that I can at least see the number returned by the function for
each
> sample. E.g. HTTP POST ${__threadNum}

OK

> Is there any way to log what file was actually sent with the POST? I
> can't tell whether there is an issue with the system under test or the
> jmeter configuration.

Does the filename appear in the Tree View Listener?
Try it with 2 or 3 threads, and remove for the main testing.

You could use the __log function:

${__log(/path/example/file_${__threadNum}.txt)}


> Regards,
>
> Alex
> This email message and any attachments thereto are intended only for
use by the addressee(s) named above, and may contain legally privileged
and/or confidential information. If the reader of this message is not
the intended recipient, or the employee or agent responsible to deliver
it to the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please
immediately notify the postmaster@nds.com and destroy the original
message.
>
> Please consider the environment before printing this email.
>
> NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath
Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
> A company registered in England and Wales   Registered no. 3080780
VAT no. GB 603 8808 40-00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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

This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.

Please consider the environment before printing this email.

NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
A company registered in England and Wales   Registered no. 3080780    VAT no. GB 603 8808 40-00


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


Re: ${__threadNum} function in HTTP POST

Posted by sebb <se...@gmail.com>.
On 05/06/07, Thomson, Alex <AT...@ndsuk.com> wrote:
> Hi,
>
> I am trying to use the ${__threadNum} function to send different files
> for each user in an HTTP POST, however it is very difficult to see what
> file path was actually sent by JMeter.
>
> e.g. 900 users, 0 ramp up & 1 loop.

That's a very high initial load; with 1 loop it's likely that startup
overhead will be a large proportion of the sample times...

> HTTP Request HttpClient POST with
> file name = /path/example/file_${__threadNum}.txt
>
> From that I presume each user will send a separate file referenced by
> the thread number.

Yes.

> I am duplicating the function call in the HTTP Request HttpClient Name
> so that I can at least see the number returned by the function for each
> sample. E.g. HTTP POST ${__threadNum}

OK

> Is there any way to log what file was actually sent with the POST? I
> can't tell whether there is an issue with the system under test or the
> jmeter configuration.

Does the filename appear in the Tree View Listener?
Try it with 2 or 3 threads, and remove for the main testing.

You could use the __log function:

${__log(/path/example/file_${__threadNum}.txt)}


> Regards,
>
> Alex
> This email message and any attachments thereto are intended only for use by the addressee(s) named above, and may contain legally privileged and/or confidential information. If the reader of this message is not the intended recipient, or the employee or agent responsible to deliver it to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please immediately notify the postmaster@nds.com and destroy the original message.
>
> Please consider the environment before printing this email.
>
> NDS Limited   Registered office: One Heathrow Boulevard, 286 Bath Road, West Drayton, Middlesex, UB7 0DQ, United Kingdom
> A company registered in England and Wales   Registered no. 3080780    VAT no. GB 603 8808 40-00
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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