2

I wrote a JMeter testplan containing hundreds of HTTP samplers/assertions. As JMeter executes each HTTP sampler, I want it to run an OS Process Sampler pre and post execution (basically call scripts to write out to remote log files on other integrated systems the start and finish points of the HTTP sampler testcase so that I know which logs correspond to which HTTP sampler executed). I don't want to have to sandwich each HTTP sampler with OS Process samplers. I was wondering if there is a way to get JMeter to execute the pre and post OS Process samplers in the background every time a HTTP sampler is run without having to explicitly add them to the testplan hierarchy. So, I currently have in the testplan tree:

  • Pre-OS Process Sampler (explicit)
    • HTTP Sampler #1
    • Assertions #1
  • Post-OS Process Sampler (explicit)
  • Pre-OS Process Sampler (explicit)
    • HTTP Sampler #2
    • Assertions #2
  • Post-OS Process Sampler (explicit)

But I want instead:

  • Pre-OS Process Sampler (on call in background)
  • Post-OS Process Sampler (on call in background)
  • HTTP Sampler #1
    • Assertions #1
  • HTTP Sampler #2
    • Assertions #2

Thanks for any guidance!

Mo

1 Answers1

0

I am not sure what you are trying to do is the right method as it will negatively impact performances of the machine hosting jmeter.

I suggest you do it differently:

  • start a listener thread that will handle the sending of logging messages, if possible try to find a better way than process launching througj java api or webservice
  • use pre/post processor using jsr223 + groovy to send your messages to it

It will be much lighter

You can have a look at:

And implement your own inspiring yourself from:

UBIK LOAD PACK
  • 33,980
  • 5
  • 71
  • 116
  • Thanks for the reply! In this case I am not too concerned with JMeter performance as I am not running this suite as a traffic performance test. I think your suggestions are in line with what is required. I was hoping that there might be a listener suite similar to the existing response collectors already built into JMeter without having to do too much extra customization. If JMeter could listen for the start/stop of an HTTP sampler and report that back to me, that would help. Cheers and thanks for the tips! – Mo Romaniuk Aug 21 '14 at 11:17
  • I updated my answer to give more infos, if answer is ok you should accept it and upvote – UBIK LOAD PACK Aug 21 '14 at 19:45