Skip to main content

Posts

Showing posts from October, 2015

JMeter maven project

Maven JMeter project is a simple load test project which demonstrates jmeter and maven integration. Please don't execute it with more than 5 threads as it uses publicly available application You can set up a CI build based on this project and parameterize build as - And now you can provide these values from building the job - To execute test locally execute following command - mvn -DAPP_URL=newtours.demoaut.com -DUSERS=$USERS -DDURATION=$DURATION  -DRAMPUP_PERIOD=$RAMPUP_PERIOD -DSTARTUP_DELAY=$STARTUP_DELAY verify Replace $USERS with number of users you want to run test with. Specify required values for other parameters and execute the tests Once test execution is over then you can browse through test results under -   /target/jmeter/results/index.html directory

SSH and screen command and JMeter

We all know how useful JMeter distributed testing is when it comes to generating how amount of load from multiple machines. This requires certain ports on remote test agent to be opened so that a centralized JMeter server could talk to them and execute test. Given the inability to get port opened on aws test agents, I could not employ JMeter distributed testing. Hence I resorted to looping through SSH connection and screen command to execute load test on remote machine. Not an ideal solution but far better than logging in to each test agent and starting test manually. If you never used screen command then Matt has a quick tutorial on it. I have load test machine image, it is child’s play to bring up load test agent with exactly same configuration on AWS. This is how for loop looks like - for server in ip1 ip2 ip3; do    ssh -tA <you ssh command here> @$server 'bash -s' < screen.sh done screen.sh is shell script which is executed on each ip address m