Giter Club home page Giter Club logo

perf-load-testing-infrastructure-setup's Introduction

Performance & Load Testing Infrastructure Setup

The following file will present instructions for complete Performance Testing infrastucture setup on your local machine. The infrastructure contains the following tools and integrations:

Performance Testing Tools:

  • Local WebPageTest instance
  • Google PageSpeed Insights

Load Testing Tool:

  • JMeter

Database storage:

  • InfluxDB

Reporting and monitoring:

  • Grafana
  • Telegraf

Prerequisites

  • Git installed - link
  • Code Editor (Visual Studio Code is preffered) - link
  • Docker capable of executing Linux containers - link
  • Node.js installed globally - link
  • [Optional] Homebrew for macOS users - link

InfluxDB setup

  1. Pull and start the InfluxDB docker image in Terminal

    Windows/macOS/Linux

    docker run -d -p 8086:8086 --name influxdb influxdb:1.8

    Windows/macOS/Linux

    docker exec -it influxdb bash
  2. Create the databases needed for all tools Windows/macOS/Linux

    influx

    Windows/macOS/Linux

    CREATE DATABASE webpagetest
    CREATE DATABASE googlepagespeed
    CREATE DATABASE telegraf
    CREATE DATABASE jmeter
  3. Access InfluxDB instance

    🌐Navigate to http://localhost:8086/ - 404 error IS EXPECTED

    🌐Navigate to http://localhost:8086/query?pretty=true&q=SELECT%20*%20FROM%20%22webpagetest%22&db=webpagetest to query the newly created Database

Grafana setup

1.Pull and run the grafana docker image

docker run -d -p 3000:3000 --name grafana grafana/grafana
  1. Add InfluxDB Datasource
  • 🌐Access Grafana by visiting http://localhost:3000/
  • Login using admin/admin
  • Set new password
  • Open Settings/Add Datasource InfluxDB
  • Fill in:
    • DataSource name: InfluxDB
    • URL: http://localhost:8086
    • Access: Select type "Browser"
    • Database name: webpagetest
  • Click on Save & Test
  • Expected result:

Screen Shot 2021-09-02 at 17 00 09

WebPageTest setup (repo link)

  1. Clone repo
    git clone https://github.com/n1xan/webpagetest-docker-setup.git
    cd webpagetest-docker-setup
    
  2. Build docker images

Windows

.\build-docker-images.bat

macOS/Linux

./build-docker-images.sh
  1. Start server and agent images

Windows

.\start-server-and-agent.bat

macOS/Linux

./start-server-and-agent.sh
  1. Access WebPageTest instance

MicrosoftTeams-image (2)

Run WebPageTest tests with InfluxDB logging repo link

  1. Clone repo
    git clone https://github.com/n1xan/webpagetest-nodejs-runner.git
    cd webpagetest-nodejs-runner
    
  2. Install dependancies and start a test
    npm install
    node webpagetest.js "https://example.com" example.com LAN Chrome
    

MicrosoftTeams-image (3)

Run Google PageSpeed test with InfluxDB Logging repo link

  1. Clone repo
    git clone https://github.com/n1xan/psi-report.git
    cd psi-report
    
  2. Install dependancies and start a test
    npm install
    node run run.js https://example.com
    

MicrosoftTeams-image (5)

Run JMeter test with InfluxDB integration

  1. Follow the tutorial: User manual link
  2. Load sample test
    git clone https://github.com/n1xan/jmeter-influx-integration.git
    cd jmeter-influx-integration
    jmeter -t DemoBellatrixNavigation.jmx
    

Configure JMeter test Grafana visualization

  1. Follow the tutorial: User manual link

Telegraf Server monitoring

  1. Download Telegraf for Windows/macOS/Linux: Download Link

  2. Run telegraf application Windows

  • Unzip
  • Edit telegraf.config
    • Set database name /should be created/
  • Save
  • cmd telegraf.exe --config telegraf.conf
  • debug telegraf.exe --config telegraf.conf --debug

macOS

  1. Download config in local folder
    mkdir ~/.telegraf
    cd ~/.telegraf
    curl -O https://raw.githubusercontent.com/influxdata/telegraf/master/etc/telegraf.conf
    
  2. Edit telegraf.config
  • open ~/.telegraf
  • Uncomment row 119
  • Set your database name if different than telegraf
  • Save file
  1. Start Telegraf application

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.