Skip to content

wilsonmar/jmeter-scripts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This contains what you need to run sample JMeter scripts.

Several sample applications are used as the basis for learning and discussing best practices:

Several people contributed to this project (and may be available for tutoring):

  • Anil Mainali
  • Wilson Mar
  • How about you?

Setup Scenarios

The components necessary for performance/capacity testing are:

A. The application under test. I've used "the-internet" because it is intended as a set of JavaScript challenges for scripting user emulation scripts. There are other sample apps.

B. JMeter to run scripts that emulate 1 or a lot of client instances. Blazemeter cloud provides that. A Docker image of the free/open-source Jenkins can be used locally or in a public cloud.

C. Environment to host the app. Dave Hoeffer has graciously created an instance on Heroku for single-user runs during scripting. But for load/capacity tests, we need to create a stand-alone app instance within a cloud.

D. CI/CD workflow engine (such as Jenkins, Harness.io, CircleCI, GitHub Actions, etc.) which builds the app under test and test for security, functionality, capacity capability, etc.

E. Monitoring (Metrics, Diagnostics, Logging) in the same environment running the app to identify trends, pin-point bottlenecks, and identify root causes.

Below are step-by-step instructions for assemblying all 5 components, in several scenarios:

  1. The simplest is to run single transactions against the "the-internet" demo app in Blazemeter for free for (not performance/load tests) after getting JMeter scripts from GitHub to your local machine and creating a free account.

  2. To run capacity tests, stand up an app instance in the cloud and run up to 20 users running a single script from Blazemeter.

  3. To run off-grid/offline during script development (if you have the memory and hard drive space), set up the app under test, JMeter. and Jenkins on your laptop.

  4. Use the CI/CD environment your devs use (such as at Harness.io, CircleCI, etc.) to run load/capacity tests.

Apache JMeter is a Git submodule to ensure that the scripts continue working even when JMeter is changed. Also, submodules provide a way to analyze what went wrong (for forensics). See https://devcenter.heroku.com/articles/git-submodules

Step 1- Download jmeter-scripts Repo from GitHub

  1. Navigate to "https://github.com/wilsonmar/jmeter-scripts"

    DJMSR_01

  2. Click on Code and click on Download ZIP.

    DJMSR_02

    Zip file is downloaded.

    DJMSR_03

  3. Navigate to download folder and unzip the folder. You may save the unzipped folder to your desired location, or you can access from download folder.

    DJMSR_04

    jmeter-scripts-main folder is unzipped.

    DJMSR_05

Step 2 – Sign up for BlazeMeter Account

  1. Navigate to https://www.blazemeter.com

    BMA_01

  2. Click on Start Testing Now Link.

    BMA_02

  3. Enter First name, Last name, Email and Click on REGISTER link.

    BMA_03

  4. Pop up screen appears. Click on Close.

    BMA_04

    BMA_05

Congratulations! You have now created a BlazeMeter Account.

Step 3- Run JMeter Scripts on BlazeMeter

https://www.blazemeter.com/blog/continuous-integration-101-how-run-jmeter-jenkins

  1. Click on Projects and click on create new project.

    RJMSFBM_01

  2. Provide a name “the-internet” and click on Create project.

    RJMSFBM_02

  3. Click on Create New Test link.

    RJMSFBM_03

  4. Click on Performance Test link.

    RJMSFBM_04

  5. Navigate to your previous downloaded “jmeter-scripts-main” folder and upload the script which you want to run by clicking on the Plus Sign.

    RJMSFBM_05

    In my case:

    C:\Users\anilm\Projects_wWilsonMar\jmeter-scripts\the-internet.

    RJMSFBM_06

    The script is uploaded onto BlazeMeter.

    RJMSFBM_07

    If you want to upload multiple files, select all the files you need to upload and upload the files at once.

  6. Next, Complete the Load Configuration.Set up total users - 1 User, Duration - 5 Minutes and ramp up time - 1 Min

    RJMSFBM_08

  7. Next, set up the load distribution. Select the desired location for LG.

    RJMSFBM_09

  8. Click on Debug Test.

    RJMSFBM_10

  9. Click on Start Debug Run.

    RJMSFBM_11

    Warming Up message

    RJMSFBM_12

    Your test will begin shortly message. Wait for some time until the test starts.

    RJMSFBM_13

    The Load Test starts.

    RJMSFBM_14

    The test completes after 5 Min with 0 % Errors

    RJMSFBM_15

  10. Click "Executive Summary"

    executive-summary

Congratulations! Now you have Downloaded jmeter-scripts Repo from GitHub to your local machine, then signed Up and run a test using BlazeMeter.

Run JMeter using Jenkins within AWS

VIDEO:

https://www.linkedin.com/pulse/running-jmeter-test-aws-ecs-anees-mohammed

Back in 2016, Amazon wrote https://aws.amazon.com/blogs/apn/performance-testing-in-continuous-delivery-using-aws-codepipeline-and-blazemeter/

https://www.jenkins.io/doc/book/using/using-jmeter-with-jenkins/

https://performanceengineeringsite.wordpress.com/2017/11/01/automating-jmeter-run-using-jenkins-ci-cd/

OPTION: Run JMeter scripts on laptop

But if you're editing scripts, install JMeter on your laptop:

  1. If you're running on your local laptop, to automatically configure your path if you do not use direnv:

    source .envrc

  2. Verify that jmeter is on your path by typing which jmeter

To run performance/load tests, we spin up instances of "The-internet" app in a cloud (AWS, Azure, GCP, etc.):

  1. TODO ...

References

NOTE: This is based on the structure of folders at

Others:

About

Automate the-internet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages