IT-SDK-JMeter

From wiki.samerhijazi.net
Jump to navigation Jump to search

Ref-Mix

Ref-JMeter

Elemente

  • Transaction controller
  • Debug Sampler
  • Constant Throughput Timer: Is used as a goal-oriented element which helps to achieve the desired throughput (Total Number of Requests).
  • Throughput Controller

Proxy

https.proxy.domain=
https.proxy.port=
https.proxy.user=
https.proxy.password=
---------------------------------
jmeter -H localhost -P 8888 -u username -a password
---------------------------------
JVM_ARGS="-Dhttps.proxyHost=myproxy.com -Dhttps.proxyPort=8080" jmeter\bin\jmeter.bat

Setting

  • JMeter Properties are global to JMeter and are mostly used to define some of the defaults JMeter uses.
  • JMeter Variables are local to each thread. The values may be the same for each thread, or they may be different.
  • -----------------
  • vars.get is used to retrieve thread-local variables within a specific thread group or thread.
  • props.get is used to retrieve global properties that are accessible throughout the entire JMeter instance.
import org.apache.jmeter.util.JMeterUtils;
.
JMeterUtils.setProperty("NAME_VALUE", vars.get("UserName"));
JMeterUtils.getProperty("NAME_VALUE");
.
${__property(NAME_VALUE)}
${__P(NAME_VALUE)}
--------------------------------------------------------------
vars.get("NAME_VALUE");
vars.put("NAME_VALUE", "XXX");
.
props.get("myVar");
props.put("myVar", "myValue");
.
${NAME_VALUE}

Functions

import org.apache.jmeter.util.JMeterUtils;
.
JMeterUtils.loadJMeterProperties("path/to/your/jmeter.properties");
JMeterUtils.saveProperties("path/to/your/jmeter.properties");
.
JMeterUtils.getProperty("myProperty");
JMeterUtils.setProperty("myProperty", "myValue");
.