liveBook · Manning

Gatling

As explained in Vibe Engineering

Gatling is a load-testing tool for simulating high-volume application traffic and measuring performance.

Gatling exposes performance tradeoffs by exercising an application end to end rather than measuring isolated code. It helps test whether optimizing a high-traffic endpoint produces more benefit than optimizing a slower, rarely used one. section 7.2.3

A practical Gatling simulation defines:

  • A Scala class extending Simulation. section 7.2.3
  • An HTTP protocol with a base URL and JSON headers. section 7.2.3
  • Scenarios that issue requests and check expected responses, such as HTTP 200. section 7.2.3
  • Traffic profiles matching expected demand, such as one request per second versus twenty requests per second. section 7.2.3
Listing 7.9 Getting the word-of-the-day’s performance
class WordsSimulation extends Simulation {
  val httpProtocol = http
    .baseUrl("http://localhost:8080/words")
    .acceptHeader("application/json")
 
  val wordOfTheDayScenario = scenario("word-of-the-day")
    .exec(WordOfTheDay.get)
object WordOfTheDay {
   val get = http("word-of-the-day").get("/word-of-the-day").check(status is 200)

Shows a minimal word-of-the-day simulation with an HTTP request, JSON acceptance, and response validation. section 7.2.3

How Vibe Engineering covers it

How deep it goes
Defines simulations, HTTP requests, response checks, and traffic injection, but uses short tests only for fast feedback.
Examples
Exercises word-of-the-day at one request per second and word-exists at twenty requests per second, checking successful HTTP responses.
What it assumes
Assumes HTTP endpoints, expected request rates, and latency measurements are available for the tested application.
What you can do after
Build Gatling simulations that generate traffic, validate responses, and compare endpoint latency under different workloads.
How it connects
Connects performance testing with load profiles, latency measurement, HTTP endpoints, JSON, and JMH-based isolated benchmarking.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.