Coder Social home page Coder Social logo

jmeterloadtest's Introduction

This is a sample load test project, demonstrating jmeter and maven integration. Please don't execute it with more than 1 thread as it uses publicly available application

You can set up a CI build based on this project and parameterize build as -

Parameterized CI build

And now you can provide these values from building the job -

Execute CI Build

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 clean 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

You can read more about maven JMeter plugin

Notice that if you want to mark CI build as fail on the basis of test results then you should use [JMeter Analysis Plugin] (https://github.com/afranken/jmeter-analysis-maven-plugin) and set the threshold level

Don't use JMeter Analysis Plugin as it requires result files to be in xml format which is more resource comsuming than csv file. Set following property to generate results in csv format - <resultsFileFormat>csv</resultsFileFormat>

Add following script on your Build section to mark CI job as failed when there is a false result,

if grep false "$WORKSPACE/prototype/target/jmeter/results/*.jtl"; then
   echo "Test Failures!!! please check "$WORKSPACE/prototype/target/jmeter/results/*.jtl" file"
   exit 1
fi

Add following script on your Build section to mark CI job as failed when threshold is less than 1 (or number according to your business case) -

SUMMARY=${WORKSPACE}/prototype/target/jmeter/logs/*.log
grep "jmeter.reporters.Summariser: summary" ${SUMMARY} | tail -1 | awk '{print $12}' | cut -d "." -f1 |
awk '{if($0<=1){echo "Thoughput is less than 1 per sec" exit 1} }'

To generate JMeter dashbaord after test run use following approach

jmeterloadtest's People

Contributors

tarun3kumar avatar

Stargazers

 avatar Pratik Barjatiya avatar Elakkiya Balu Rajesh avatar Krishnakanth avatar  avatar

Watchers

James Cloos avatar Krishnakanth avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.