0
votes

I am trying to perform load test using jmeter. I have my script to extract and generate .json output file which is using ruby. Now i want to use this output.json ( which changes with every thread event) in jmeter and run it with 100 threads. How do I call .rb using jmeter gui?

2

2 Answers

1
votes

You can use OS Process Sampler to invoke whatever external command or program from JMeter test script.

Example configuration:

enter image description here

Change:

  • c:\apps\ruby\bin\ruby.exe to the actual path to your ruby executable
  • c:\temp\script.rb to the actual path of your .rb script

More information: How to Run External Commands and Programs Locally and Remotely from JMeter

0
votes

You can execute ruby in JMeter using jruby script engine

  1. Dowonload jruby-engine.jar

  2. Copy to JMeter lib directory with ruby relevant jars (as jruby-core)

  3. In JSR223 choose language as jruby

  4. Write your ruby script and run test

Notice that JRuby find predefined variable using $ prefix:

$log.info("Hello from JRuby");