Gatling is a load and stress testing framework written in Scala, a functional programming language that runs on the JVM. The framework uses the Akka framework for handling concurrency and the Netty framework for handling network operations. The software is very stable and can scale to handle distributed workloads. Gatling focusses exclusively on web load testing and therefor only supports HTTP, JMS, WebSockets and Server-sent events. Configuration of the load tests is done using a Scala based Domain Specific Language.
Gatling can be used as a low cost method of testing nonprofit web servers or other servers in a situation where the test subject doesn’t have a lot of money to run testing, but when testing is really important. Typically, nonprofit organizations don’t often have the best resources and often their servers are slow, although this isn’t always the case—you can check this out if you’re looking for more information on nonprofit servers in general and how to get the best one for your organization. That said though, testing is really important for nonprofits to make the most of what they have.
Before using Gatling for load testing you will need a client for generating the load and a web server that will respond to the requests. The client should have JDK8, Maven and Scala installed. Installing Gatling is easy as you only requires the zip file. You unzip the files in your preferred folder and Gatling is ready to run as long the prerequisites are installed.
Next you need to configure the simulation scripts and scenarios. The scripts are written in the Scala DSL but one need not be versed in Scala to use Gatlin. Developers should also note their text encoding format. Gatling uses UTF-8 encoding by default. If your server uses a different encoding, change it in the gatling.conf file. The gatling.conf file also contains all requests and simulations.
In load testing, scenarios are steps that a user will take when completing an action. A scenario usually includes requesting several web pages in a particular order and performing searches for example a common scenario for an ecommerce site would involve a user searching for a specific item and then ordering that item. Gatling provides Recorder, a tool that records actions on a website and then exports them to Gatling scenarios in the proper Scala format. Users launch the script by running a script in the bin folder. The script is named recorder.bat on Windows and recorder.sh on Unix based systems. Additionally Recorder helps you configure how responses and requests will be handled. Once you run Recorder, Gatling will produce a scenario in the required Scala format. You then run the gatling.sh or gatling.bat file depending on your OS and Gatling will run your load tests. After the tests have been completed, Gatling will provide a link to the reports for the tests.