Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/gatling/gatling.io-doc/llms.txt

Use this file to discover all available pages before exploring further.

The test-as-code path is the recommended workflow for teams that version their load test scenarios alongside their application code. You write your simulation in Java, Kotlin, Scala, JavaScript, or TypeScript, package it with the corresponding Gatling build plugin, and upload the resulting artifact to Gatling Enterprise Edition. From there, the platform handles provisioning load generators, distributing the test across locations, and collecting metrics at scale.

Prerequisites

Before you can create a test-as-code test, you must have at least one package uploaded to Gatling Enterprise. Packages are built by the Gatling Maven, Gradle, sbt, or JavaScript/TypeScript plugin and registered in the Sources section of the UI.
See the CI/CD integration guides for step-by-step upload instructions using build plugin commands and automated pipelines.

Creating a test-as-code test

1

Open the test creation modal

In the Tests view, click Create a test. If the Tests view is empty, click Get started with test-as-code tests. The creation modal opens.Select Test-as-code from the three available options, then click Create.
2

Set the general parameters

Configure the following fields:
FieldDescription
NameA human-readable label shown in the tests table. Choose something meaningful to identify the simulation at a glance.
PackageThe uploaded package that contains your simulation code.
TestThe specific simulation class to run from within the selected package.
3

Configure load generator locations

Choose where Gatling Enterprise will start your load generators.
Managed locations are operated by Gatling. Each load generator has the following specifications:
  • CPU: 4 cores
  • RAM: 8 GB
  • Network: up to 10 Gbit/s
Available regions:
  • AP Pacific (Hong Kong)
  • AP Pacific (Tokyo)
  • AP Pacific (Mumbai)
  • AP SouthEast (Sydney)
  • Europe (Dublin)
  • Europe (London)
  • Europe (Paris)
  • SA East (São Paulo)
  • US East (N. Virginia)
  • US West (N. California)
  • US West (Oregon)
It is not possible to mix managed locations, private locations, and dedicated IPs within the same test. Choose one type per test configuration.
For each location you add, configure:
FieldDescription
LocationThe geographic region where load generators will be spawned.
Number of load generatorsHow many parallel load generator instances to run in this location.
Weight distributionOptional. When enabled, assign a percentage of the total load to each location. All weights must sum to 100%.
You can add multiple locations with different generator counts to simulate geographically distributed user traffic.
4

Apply optional configurations

The following settings are optional. Expand each section in the test creation form to configure them.
Replace the injection profile defined in your simulation code without modifying or re-packaging it. The override completely replaces the code-defined profile and is saved with the test.Two injection models are available:
  • Open model — you control the arrival rate (users per second). Choose this when testing a specific request throughput.
  • Closed model — you control concurrent users. Choose this when your system queues excess traffic.
Open model step types:
StepDescriptionParameters
At Once UsersInject a fixed number of users at onceUsers
Ramp UsersInject users evenly over a durationUsers, Duration (s)
Constant Users/secInject at a constant rateRate (users/s), Duration (s)
Ramp Users/secRamp the rate from one value to anotherFrom, To (users/s), Duration (s)
Stress Peak UsersInject using a Heaviside step functionUsers, Duration (s)
Closed model step types:
StepDescriptionParameters
Constant Concurrent UsersMaintain a constant concurrent poolUsers, Duration (s)
Ramp Concurrent UsersRamp between two concurrent valuesFrom, To, Duration (s)
The configured override completely replaces the injection profile from your simulation code. Only the scenario execution logic is preserved. A mismatch in scenario names causes the run to fail with a Broken status.
Specify Java system properties (JVM) or JavaScript parameters and environment variables for this test. These are applied on top of the default parameters unless you uncheck Default properties.
Prefix sensitive system properties with sensitive. and sensitive environment variables with SENSITIVE_ to exclude them from run snapshots.
Use the gatling.enterprise.groupedDomains Java system property to consolidate connection stats from many subdomains. For example, setting .foo.com, .bar.com groups sub1.foo.com and sub2.foo.com under *****.foo.com.
Define one or more SLOs that gate the run’s success. Each SLO is evaluated over the run duration and reports the percentage of seconds the condition was met.
FieldOptions
MetricError ratio, or Response time percentile (p50, p95, p99, p99.9, p99.99, p99.999, p99.9999)
OperatorLess than (<) or less than or equal ()
ThresholdMilliseconds (response time) or percentage (error ratio)
SLO compliance is colour-coded in the run summary:
  • 🟢 Green: ≥ 99% of seconds met the condition
  • 🟠 Orange: 90–99% of seconds met the condition
  • 🔴 Red: < 90% of seconds met the condition
Adding SLOs to a test overwrites any assertions defined in the simulation code. When SLOs are configured, code assertions are not evaluated.
Exclude warm-up and cool-down periods from SLO and assertion calculations.
FieldDescription
Ramp UpSeconds to exclude from the beginning of the run
Ramp DownSeconds to exclude from the end of the run
Ramp-up/down parameters are only applied when the run duration exceeds the sum of both values.
Terminate a run early when a metric exceeds a threshold for a given time window. Each criterion requires:
FieldDescription
MetricMean CPU usage, Global error ratio, or Global response time (at a specific percentile)
ThresholdThe value that triggers the stop condition
TimeframeDuration (in seconds) the metric must exceed the threshold continuously
Example: stop the run if mean CPU usage exceeds 80% for the last 60 seconds.
5

Save and launch

Click Save and Launch to persist the test configuration and immediately start a new run. You can also click Save to keep the configuration without starting a run, then launch it later from the tests table.

Managing existing tests

From the Tests view, use the kebab menu (⋮) at the far right of any row to:
  • Edit test — open the creation modal pre-filled with the current configuration
  • Duplicate test — clone the test to a new configuration you can modify independently
  • Copy test ID — copy the UUID for use in API calls
  • Delete test — permanently remove the test and its configuration
Deleting a test does not delete its historical run results. Run data remains accessible from the Trends view until explicitly deleted there.

Default load generator parameters

Organization-wide default parameters (Java system properties, JS parameters, environment variables) can be set from the top-right button on the Tests view. These defaults propagate to every test unless a test explicitly opts out by unchecking Default properties.
Default parameters are a convenient way to inject environment-specific configuration (such as target host URLs or feature flags) across all tests without duplicating settings.

Build docs developers (and LLMs) love