Bug 49975

Summary: New function returning the name of the current sampler
Product: JMeter - Now in Github Reporter: jens_0
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: enhancement CC: jens_0
Priority: P2    
Version: 2.4   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Attachments: function sampler name

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.
Comment 5 The ASF infrastructure team 2022-09-24 20:37:45 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2401