Introduction to the

Gatling is a high performance server performance testing tool developed based on Scala. It is mainly used to test the server load, and analyze and measure the various performance indicators of the server. Gatling is primarily used to measure HTTP-based servers, such as Web applications, RESTful services, etc. In addition, it has the following features:

  • Akka Actors and Async IO are supported for high performance
  • Support for real-time generation of HTML dynamic lightweight reports, which makes the reports easier to read and analyze
  • Support for DSL scripts, making test scripts easier to develop and maintain
  • Support recording and generating test scripts, so you can easily generate test scripts
  • Support for importing HAR (HTTP Archive) and generating test scripts
  • Support for Maven, Eclipse, IntelliJ, etc., for easy development
  • Jenkins support for continuous integration
  • Plug-ins are supported so that their functionality can be extended, such as support for other protocols
  • Free open source

Download: Gatling’s website

  • Free version of Gatling Open Source
  • A paid version of Gatling Frontline

Install the Gatling

scoop install gatling

After successful installation, the directory structure is as follows:

  • Bin: Gatling has only two kinds of components – recorded components and running components; There are two scripts in this directory. One is to run the Recorder (the recording component launch script); One is the startup script to run the component;
  • Conf: The directory where the configuration files are placed. In general, if you want to change some running parameters, you can do it here;
  • Lib: There are some JARs that Gatling is running on; We, as users, don’t have to worry about it for a while;
  • Results: Test report directory;
  • Target: After you launch and run the component, Gatling will compile all the.Scala scripts for you, and the compiled class file will be here.
  • User-files: store your recorded.Scala scripts;

<br/>

Create a Gatling project using Maven

Environment to prepare

  1. Install the JDK

    scoop install adopt8-hotspot
  2. Install maven

    scoop install maven
  3. Install scala

    scoop install scala
  4. Install the idea

    scoop install idea

Create a project

  • Idea Create Skeleton

  • Create a skeleton
Highcharts artifactId: gatling-highcharts-maven-archetype Version: 3.5.0

Click to see the latest version

  • Create a project





  • Wait for the above project to compile, then install the Scala plug-in

  • Official Test Project

  • Custom projects, referencing JAR packages

  • Run the test

  • View the test report

Reference documentation

https://www.jianshu.com/p/90a…

https://blog.csdn.net/qunyaoa…