Bug 49975 - New function returning the name of the current sampler
New function returning the name of the current sampler
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: Main
2.4
PC Windows XP
: P2 enhancement (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2010-09-22 10:00 UTC by jens_0
Modified: 2011-04-20 08:35 UTC (History)
1 user (show)



Attachments
function sampler name (2.07 KB, application/octet-stream)
2010-09-22 10:00 UTC, jens_0
Details

Note You need to log in before you can comment on or make changes to this bug.
Description jens_0 2010-09-22 10:00:59 UTC
Created attachment 26064 [details]
function sampler name

For tagging of load test requests in a monitoring tool I needed the possiility to add the name of the current sampler to the HTTP header. I implemented the following new function that can be used in the test's HTTP Header Manager.
Comment 1 Sebb 2010-09-23 17:31:47 UTC
Thanks.

I added an optional variable name.

Also, the code needs to check for null Sammpler object (which can happen e.g. if the function is used on the Test Plan - not that it makes sense there).

URL: http://svn.apache.org/viewvc?rev=1000632&view=rev
Log:
Bug 49975 - New function returning the name of the current sampler

Added:
   jakarta/jmeter/trunk/src/functions/org/apache/jmeter/functions/SamplerName.java   (with props)
Modified:
   jakarta/jmeter/trunk/xdocs/changes.xml
   jakarta/jmeter/trunk/xdocs/usermanual/functions.xml
Comment 2 Ralf Hauser 2011-04-20 07:40:27 UTC
when will this be deployed?

http://jakarta.apache.org/jmeter/usermanual/functions.html

still doesn't show 

 <tr><td>Information</td><td> <a href="#__samplerName">samplerName</a></td><td>get the sampler name (label)</td></tr>

...
Comment 3 Ralf Hauser 2011-04-20 07:56:44 UTC
see also bug 51091
Comment 4 Sebb 2011-04-20 08:35:37 UTC
(In reply to comment #2)
> when will this be deployed?

With the next JMeter release.

> http://jakarta.apache.org/jmeter/usermanual/functions.html
> 
> still doesn't show 
> 
>  <tr><td>Information</td><td> <a
> href="#__samplerName">samplerName</a></td><td>get the sampler name
> (label)</td></tr>
> 
> ...

Because that documentation is for the current release.