angie4u / bot-load-test

Describe how to do load test for bot

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

How to do load test for deployed bot?

I had a project which I need a load test for deployed bot. There was a blog post, but it doesn't give the detailed description how to configure load test environment for deployed bot so I wrote this tutorial.

1. Prerequisite

Up and running bot! (If not, you can deploy one of the sample bots on github) 000

2. Prepare a VM for Load Testing

Create a VM for Load Test Client (For Windows OS)

This is the original blog post that I followed to setup the environment.

Change default setting of VM

  1. Create Windows Server 2019 Datacenter vm on Azure. 001

  2. Turn off IE Enhanced Security Configuration 002 To install the following programs, you need to change the security setting for IE.

  3. Turn off Windows Firewall setting like below. 031

Install JDK

  1. Download JDK 003
  2. Add system variable for "JAVA_HOME" 004
  3. Add this to the PATH 005

You need to restart your VM after edit environment variable.

  1. Restart your VM and check if JDK installed 006

Install Apache JMeter

  1. Download Apache JMeter. 007
  2. Extract zip file. 008

Install Apache Maven

  1. Download Apache Maven 009

  2. Extract zip file

  3. Add "MAVEN_HOME" as a system variable 010

  4. Add this variable to PATH 011

  5. Restart the VM and check the maven version 012

Clone BotServiceStressToolkit project and create JAR file

  1. Clone BotServiceStressToolkit project on Github

    If you want to use git clone, you need to download git(https://git-scm.com/) first.

  2. Move to "BotServiceStressToolkit" directory

  3. Execute following command.

    mvn clean package
    

    013

  4. Copy the JAR file under target folder after step3 completed. 016

  5. Paste those JAR files under Apache JMeter ~/lib/ext 017

3. Execute Load Testing for the bot

Configuration for test VM on Azure Portal

I use 45678 port for this, but this can be any port number you prefer.

  1. Open Azure portal and go to the VM you create
  2. Go to network setting page 014
  3. Add inbound port rule like below. 015

Configuration for Apache JMeter

  1. Open Apache JMeter under Apache JMeter ~/bin/jmeter.bat 018

  2. Create Thread group 019

  3. Create Bot Service: Configuration 020

  4. Update the configuration info for deployed bot. 021 Those are the field you need to update

    • Bot URL: http://your-app-service-name.azurewebsites.net/api/messages
    • Callback URL: http://your-vm-public-ip:your-port-number
    • Callback Server Listen Host: your-vm-private-ip
    • Callback Server Listen Port: your-port-number
  5. Create Bot Service: Security Configuration 029

  6. Update AppId and App Secret 030

  7. Create Bot Service: Conversation Update 023

  8. Modify the Conversation Update setting 024

  9. Add "View Result Tree" 027

  10. Add "Aggregate Report" 028

  11. Save this flow before run the test 026

  12. Check the test result 032 033

  13. Increase thread 1 to 100(as many as you want) for load test. 034 035

You can add assertion and so on. If you want to know more detail on this, please read the blog post below!

About

Describe how to do load test for bot

License:MIT License