Bug 47394 - It should be easier to plug a custom SampleSender in jmeter
Summary: It should be easier to plug a custom SampleSender in jmeter
Alias: None
Product: JMeter
Classification: Unclassified
Component: Main (show other bugs)
Version: 2.3.3
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
Depends on:
Reported: 2009-06-19 01:58 UTC by benoit.wiart
Modified: 2009-06-19 19:15 UTC (History)
0 users

sample sender factory patch (1.77 KB, patch)
2009-06-19 16:19 UTC, benoit.wiart
Details | Diff
jmeter.properties patch (703 bytes, patch)
2009-06-19 16:21 UTC, benoit.wiart
Details | Diff
documentation patch (512 bytes, patch)
2009-06-19 16:24 UTC, benoit.wiart
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description benoit.wiart 2009-06-19 01:58:53 UTC
It's not possible to plug a custom SampleSender without making change in SampleSenderFactory and recompiling jmeter.

It should be possible to provide the implementation class in the config file

If the jmeter dev / comitters thing are willing to accept this change then I will provide a patch (keeping backward compatibility)
Comment 1 benoit.wiart 2009-06-19 02:04:38 UTC
How it will be done (open to discussion) :

add a new optionnal parameter in the config file (ex : sample.sender.class)
If the parameter is set
    load the class and create a new instance of the samplesender
    if it fails default to StandardSampleSender + log the exception
    use the 'old' parameters 'mode' and 'hold_samples' 

Benoit Wiart
Ubik Ingénierie
Comment 2 Sebb 2009-06-19 04:49:15 UTC
This is a good idea.

Regarding properties: I don't think it's necessary to add yet another property; just set hold=false and mode=classname.

If the class is not found, I think the run should fail rather than reverting to StandardSampler.

Please submit a patch. Ideally this should cover the factory class, jmeter.properties and the user documentation.
Comment 3 benoit.wiart 2009-06-19 16:19:37 UTC
Created attachment 23836 [details]
sample sender factory patch
Comment 4 benoit.wiart 2009-06-19 16:21:30 UTC
Created attachment 23837 [details]
jmeter.properties patch
Comment 5 benoit.wiart 2009-06-19 16:24:15 UTC
Created attachment 23838 [details]
documentation patch
Comment 6 Sebb 2009-06-19 19:15:49 UTC
Thanks for the patches, which have been applied to SVN:

URL: http://svn.apache.org/viewvc?rev=786747&view=rev
Bug 47394 - It should be easier to plug a custom SampleSender in jmeter

The updated code will be in nightly builds after r786747.