TestingWithArif
TestingWithArif

Reputation: 894

PerfMon plugin throwing error (with use of variables) in JMeter distributed Mode

I have implemented PerfMon Metrics Collector (listeners) in my JMeter scripts. These listeners have HOST and PORT fields. I have defined variables for these in Test Plan and using them in listeners.

I tested these scripts in non-distributed mode and it worked perfectly.

Sample Screenshot

Now, I converted my scripts for distributed mode. Everything works fine except PerfMon listeners which throw following error message:

2016/02/29 09:06:35 ERROR - kg.apc.jmeter.perfmon.PerfMonCollector: Perfmon plugin error: java.net.ConnectException: connect: Address is invalid on local machine, or port is not valid on remote machine

This error seemed to be related to invalid value (may be these listeners do not handle special characters like {} $ in distributed mode!!). So, I removed variables for HOST/PORT and instead used hard coded values and it worked fine.

So apparently, these listeners do not work properly in distributed mode (IF used with variables).

Is there any workaround for this issue as I have plenty of PerfMon listeners in my setup and manually changing them all will be a tiresome job.

Upvotes: 0

Views: 683

Answers (1)

Dmitri T
Dmitri T

Reputation: 168092

Go for JMeter Properties instead of JMeter Variables, like:

  • Substitute ${HOST} with ${__P(HOST,)}
  • Substitute ${PORT} with ${__P(PORT,)}
  • Pass HOST and PORT properties values on JMeter master side like:

    jmeter -GHOST=target_hostname_or_IP -GPORT=target_port -s -n -t ....
    
  • You can have different values on different slaves, in that case specify properties in user.properties file (it's located under /bin folder of JMeter installation) like:

    HOST=10.20.30.40
    PORT=1234
    

    Remember to restart JMeter after editing any configuration file.

References:

Upvotes: 1

Related Questions