By Hamid Al-qiari - Performance Test Lead
Outline:
Introduction
What Is Gatling?
Gatling vs. JMeter
Gatling Cons
The Solution: Taurus for Gatling Users
How to Use Gatling With Taurus
Conclusion
Gatling and JMeter have different features based on what you're looking for, but they're not without their disadvantages. Taurus can help fill in the gaps.
The open-source community often discusses whether to use JMeter or Gatling for load testing. Both are strong tools, and they become even stronger through Taurus. This post covers the differences between Gatling and JMeter and shows you how to run a Gatling test easily through Taurus.
What Is Gatling?
Gatling is an open-source, cross-platform, load testing Java application that uses Scala scripting language. Gatling is a command line tool, i.e., it has no GUI or Web UI, which implies a certain level of technical knowledge for its users (unless you use it through Taurus, which we will discuss further on).
Gatling enables its users to enjoy the full power of working with a programming language, without the limits of GUI DSL. It also has easy-to-use custom code pieces and extra libraries, flexible load-injection profiles, and an asynchronous concurrency model, which saves resource usage as one thread can serve many VUs and connections.
Gatling vs. JMeter
While Gatling and JMeter have different features, we don’t recommend one over the other. Rather, they are both strong and have similar abilities (when JMeter is used with its plugins). Therefore, it’s up to you to choose which one you prefer and like to work with.
Gatling Cons
While Gatling is a powerful tool, it has a few disadvantages:
Not for beginners. The larger number of prerequisites and high technical skills that are needed make it hard to use for beginners.
No real-time reports. Rich real-time reports are crucial for load testing nowadays. Developers need to be able to run a test and analyze the results immediately.
No reports storage. Reports aren’t collaborative, can’t be shared between team members and can’t be analyzed over time to identify KPI trends. This is true for JMeter as well.
No distributed testing. Tests can be run only on your local machine. JMeter has limited distributed testing.
Slow startup time (especially for complex scripts).
The Solution: Taurus for Gatling Users
Taurus is an open-source automation load testing tool that fills in the existing gaps in JMeter, Selenium, and Gatling. Gatling users can run Taurus and gain the advantages of both.
Here’s how:
Simplified scripting. Taurus scripts are very easy, and even a list of URLs is enough to start running a load test. Users can use Gatling without having to learn Scala or understand the Gatling file layout, load profile specifications or other requirements.
Automation. When you run tests every day, any second you lose becomes a problem. Taurus makes everyday usage convenient by automating tests and by integrating with Continuous Integration tools like Jenkins.
Reporting and scaling capabilities. Taurus answers modern requirements and extends existing open-source tools capabilities by providing rich real-time reports. With BlazeMeter (no payment required) these reports are also stored. Storage abilities enable developers to conduct KPIs analysis over time over complex correlations.
Heterogeneous testing. Taurus enables easily running Gatling and Selenium at the same time. This way, developers can generate the backend load test and track the front-end user experience at the same time.
How to Use Gatling With Taurus
First, install Taurus
Before Taurus and after Python installation, check if you have the following modules installed:
The simplest Taurus installation requires you to use pip package manager:
and for upgrade:
Keep in mind that some additional software can be required depend on the test type (Java, specific Python tools like Locust, etc.). Below you can see some specific info for different operating systems.
Unstable features
We use the following mark
This is available only in unstable snapshot.
for the features that will be released soon but at the moment can't be installed from PyPi and available in the pointed topic only.
Linux
You will need Python 3.7+ and Java installed. To install Taurus on Linux, do the following instructions:
Upgrading to latest is as simple as this:
Alternatively, you can install using virtualenv, and you won't need sudo privileges for Taurus. Please see virtualenv instructions for setting up your Python virtual environments, if you haven't done so already.
Then, to install Taurus, type:
Upgrade is simply:
Mac OS
Install Homebrew Package
You can use brew package manager to install Taurus:
and to update it:
If your brew auto update is switched off don't forget to manage it manually.
NOTE: There is an issue with brew installation connected with numpy. In order to avoid this problem we suggest installing Taurus using pip tool.
To install Taurus with pip you need command line developers tools and Python 3.7+ installed. Then you need to install Cython if it is not installed using the following command:
Then just install bzt:
To upgrade, use:
Windows
Preparation steps:
Get Python 3.7+ from http://www.python.org/downloads and install it, don't forget to enable "Add python.exe to Path" checkbox.
Get the latest Java from https://www.java.com/download/ and install it.
Get the latest Microsoft Visual C++ and install it.
Please check that the 'Desktop Development with C++' box is checked during installation.
Also, do not forget to update pip, setuptools, and wheel with the following command:
After all those steps, install Taurus:
Now, create a configuration file. The Taurus configuration file has two parts: the execution and the scenarios.
For example:
This test examines the Blaze demo website. By using the Gatling load testing tool, it tests 10 concurrent virtual users , with a ramp-up time of 30 seconds, the load is held then for two minutes. The test specifies GET requests with asserts it to include word “sometext,” and then sends a POST request to blazedemo/reserve.php with Some Body Data in the body, defines a two-second think time before sending the requests, and asserts that the HTTP code isn’t 200.
To run the test type:
Taurus will show you KPI results in real-time, as fast as they appear on Gatling. KPIs include latency times, response codes, percentiles, etc.
Taurus doesn’t require scripting, but it does generate a Scala file internally, which looks like this:
As you can see, Taurus scripting language is easy, and it is much easier than Scala. It also enables you to go back, interrupt the test and edit the file, if you need to.
You can also view the reports of your Taurus test on BlazeMeter without having to sign up for BlazeMeter. Just add -report to your command line, and CA BlazeMeter will open up with statistics, KPI correlations, timeline reports, etc. These reports can be shared between team members.
Congratulations! You can now easily run Gatling through Taurus and view report results on BlazeMeter.
Comments
Post a Comment