DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
  1. DZone
  2. Popular
  3. Open Source
  4. Measuring Performance With Gatling

Measuring Performance With Gatling

Learn the basics of using Gatling, an open-source tool for load testing.

Canberk Akduygu user avatar by
Canberk Akduygu
·
Dec. 12, 18 · Tutorial
Like (3)
Save
Tweet
Share
9.32K Views

Join the DZone community and get the full member experience.

Join For Free

There are many open-source tools and paid solutions to perform load tests efficiently.  At Loadium, we have supported Apache JMeter and Selenium-based tests for load testing. Gatling, a load test tool, has been on the market for a few years and it’s a mature performance testing tool to use.  In the near future, we are going to support Gatling tests.

First, it is an open-source load testing framework for your web application and web service tests. It’s very easy to install Gatling onyour local machine. Scenarios are implemented with a simple domain specific language (DSL). If you are familiar with DSL-type testing frameworks, it will be very easy to adopt Gatling for your performance tests. You can generate readable and easy to maintain performance test code.

Pros & Cons of Gatling

Pros of Gatling:

  • High performance: You can inject more virtual users on a local machine compared to JMeter
  • The scenario recorder is very user-friendly and creates easy to read DSL scenarios
  • Great visual HTML reports

Cons of Gatling:

  • Limited Protocol Support: As you know, JMeter has over 20+ protocol support with the plugins, etc.
  • IDE: You only have a recorder as a UI. You should do some coding for JSON, XML, or CSS operations.

Actually, we cannot say those are some cons; there is some missing stuff compared to JMeter. Gatling is more of a developer/QA tool by nature.

Tech Stack Behind Gatling

  • HTTP
  • JMS
  • WebSockets
  • Server-sent events

Gatling’s installation process is simple and doesn’t require machine-by-machine basis installation.

Gatling projects can be started like any other Maven project. It has its own archetype and gives you a good starting point.

Gatling is built on Scala, Akka, and Netty. Scenarios should be developed in Scala, so that’s another language to learn for some of us.

Gatling also provides a visually rich report full of data to tell us what’s going on with the application under test.

You can easily integrate Gatling tests with Jenkins even if you don’t use Loadium or similar cloud-based products.

You can execute your Gatling tests with the help of a maven plugin and Gradle plugin.

Scenario Architecture of Gatling

Basically, load testing scenarios can be structured in four different parts:

HTTP Protocol Configuration

This is the base URL that runs against your tests. You can also do some global configuration like user agent, language header, connection, and so on.

Headers Definition

As with all HTTP requests, you need to define headers with a request that will be sent to the server. Sometimes you might need them, but for realistic load testing, the headers add a bit of a load on servers that are testing.

Scenario Definition

The core of your test! A scenario includes a group of actions (like GET, POST, etc.) that are executed to simulate a user’s interaction with the application. You can find information about HTTP requests in our previous article. 

Simulation Definition

This is where you define the behavior of your real users. You define the load (number of users), ramp-up, and execution time that concurrently executes your scenario. Then, all you need to do is to execute your test from the command line client. You have the HTML report to analyze the response times of your request.

Those are the basics of Gatling. We’ll discover more in our next blog posts.

Stay tuned!

Gatling (software) Testing Open source Domain-Specific Language

Published at DZone with permission of Canberk Akduygu. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top 5 Node.js REST API Frameworks
  • Explainer: Building High Performing Data Product Platform
  • RabbitMQ vs. Memphis.dev
  • Building a Scalable Search Architecture

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: