Skip to content

Commit 5bfad82

Browse files
committed
Gatling: 3.11.4
1 parent 31f638d commit 5bfad82

File tree

9 files changed

+104
-127
lines changed

9 files changed

+104
-127
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ All applications implement the same functionality and expose the same REST api
2121
- `./run-micronaut.sh`
2222
- `./run-quarkus.sh`
2323
4. Run Gatling:
24-
- `./gradlew :loadtest:gatlingRun-gatling.simulation.AppSimulation`
24+
- `./gradlew :loadtest:gatlingRun --simulation gatling.simulation.AppSimulation`
2525

2626
<details>
2727
<summary>Check wiremock performance</summary>
@@ -30,7 +30,7 @@ All applications implement the same functionality and expose the same REST api
3030
1. Spin Up Wiremock:
3131
- `docker-compose up -d wiremock`
3232
4. Run Gatling:
33-
- `./gradlew :loadtest:gatlingRun-gatling.simulation.WiremockSimulation`
33+
- `./gradlew :loadtest:gatlingRun --simulation gatling.simulation.WiremockSimulation`
3434

3535
</details>
3636

loadtest/README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Gatling
2+
3+
## Run
4+
5+
Run all simulations
6+
- `gradle gatlingRun --all`
7+
8+
Run one simulation
9+
- `gradle gatlingRun --simulation gatling.simulation.AppSimulation`
10+
11+
12+
## Useful links
13+
14+
- [Official Demo Gatling Project](https://github.com/gatling/gatling-gradle-plugin-demo-java)

loadtest/build.gradle

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
plugins {
22
id 'java'
3-
id 'io.gatling.gradle' version '3.9.5'
3+
id 'io.gatling.gradle' version '3.11.4'
44
}
55

66
group = 'bitxon'
@@ -16,9 +16,6 @@ dependencies {
1616
}
1717

1818
gatling {
19-
// WARNING: options below only work when logback config file isn't provided
20-
logLevel = 'WARN' // logback root level
21-
logHttp = 'NONE' // set to 'ALL' for all HTTP traffic in TRACE, 'FAILURES' for failed HTTP traffic in DEBUG
2219
enterprise {
2320
// Enterprise Cloud (https://cloud.gatling.io/) configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-cloud
2421
// Enterprise Self-Hosted configuration reference: https://gatling.io/docs/gatling/reference/current/extensions/gradle_plugin/#working-with-gatling-enterprise-self-hosted

loadtest/src/gatling/java/gatling/Engine.java

-16
This file was deleted.

loadtest/src/gatling/java/gatling/IDEPathHelper.java

-28
This file was deleted.

loadtest/src/gatling/java/gatling/simulation/AppSimulation.java

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class AppSimulation extends Simulation {
4949
//-----------------------------------------------------------------------------------------------------------------
5050

5151
private static ChainBuilder postAccount(String sessionFieldNameForId) {
52-
return exec().feed(feederPost).exec(http("Create")
52+
return feed(feederPost).exec(http("Create")
5353
.post("/accounts")
5454
.header("Content-Type", "application/json")
5555
.body(StringBody("""
@@ -68,7 +68,7 @@ private static ChainBuilder postAccount(String sessionFieldNameForId) {
6868
}
6969

7070
private static ChainBuilder postInvalidAccount() {
71-
return exec().feed(feederInvalidPost).exec(http("Create (400,422)")
71+
return feed(feederInvalidPost).exec(http("Create (400,422)")
7272
.post("/accounts")
7373
.header("Content-Type", "application/json")
7474
.body(StringBody("""
@@ -100,7 +100,7 @@ private static ChainBuilder getAllAccounts() {
100100
}
101101

102102
private static ChainBuilder postTransfer() {
103-
return exec().feed(feederTransfer).exec(http("Transfer")
103+
return feed(feederTransfer).exec(http("Transfer")
104104
.post("/accounts/transfers")
105105
.header("Content-Type", "application/json")
106106
.body(StringBody("""

loadtest/src/gatling/resources/gatling.conf

+64-73
Original file line numberDiff line numberDiff line change
@@ -6,122 +6,113 @@
66

77
gatling {
88
core {
9-
#outputDirectoryBaseName = "" # The prefix for each simulation result folder (then suffixed by the report generation timestamp)
10-
#runDescription = "" # The description for this simulation run, displayed in each report
11-
#encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation
12-
#simulationClass = "" # The FQCN of the simulation to run (when used in conjunction with noReports, the simulation for which assertions will be validated)
9+
#encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation
1310
#elFileBodiesCacheMaxCapacity = 200 # Cache size for request body EL templates, set to 0 to disable
14-
#rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body Raw templates, set to 0 to disable
15-
#rawFileBodiesInMemoryMaxSize = 1000 # Below this limit, raw file bodies will be cached in memory
16-
#pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Peeble templates, set to 0 to disable
11+
#rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body raw files, set to 0 to disable
12+
#rawFileBodiesInMemoryMaxSize = 10240 # Max bite size of raw files to be cached in memory
13+
#pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Pebble templates, set to 0 to disable
1714
#feederAdaptiveLoadModeThreshold = 100 # File size threshold (in MB). Below load eagerly in memory, above use batch mode with default buffer size
1815
#shutdownTimeout = 10000 # Milliseconds to wait for the actor system to shutdown
1916
extract {
2017
regex {
21-
#cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching
18+
#cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching
2219
}
2320
xpath {
24-
#cacheMaxCapacity = 200 # Cache size for the compiled XPath queries, set to 0 to disable caching
21+
#cacheMaxCapacity = 200 # Cache size for the compiled XPath queries, set to 0 to disable caching
2522
}
2623
jsonPath {
27-
#cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching
24+
#cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching
2825
}
2926
css {
30-
#cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching
27+
#cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching
3128
}
3229
}
33-
directory {
34-
#simulations = user-files/simulations # Directory where simulation classes are located (for bundle packaging only)
35-
#resources = user-files/resources # Directory where resources, such as feeder files and request bodies are located (for bundle packaging only)
36-
#reportsOnly = "" # If set, name of report folder to look for in order to generate its report
37-
#binaries = "" # If set, name of the folder where compiles classes are located: Defaults to GATLING_HOME/target.
38-
#results = results # Name of the folder where all reports folder are located
39-
}
4030
}
4131
socket {
42-
#connectTimeout = 10000 # Timeout in millis for establishing a TCP socket
32+
#connectTimeout = 10000 # Timeout in millis for establishing a TCP socket
4333
#tcpNoDelay = true
44-
#soKeepAlive = false # if TCP keepalive configured at OS level should be used
34+
#soKeepAlive = false # if TCP keepalive configured at OS level should be used
4535
#soReuseAddress = false
4636
}
4737
netty {
48-
#useNativeTransport = true # if Netty native transport should be used instead of Java NIO
49-
#allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator
50-
#maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k
38+
#useNativeTransport = true # if Netty Linux native transport should be used instead of Java NIO
39+
#useIoUring = false # if io_uring should be used instead of epoll if available
40+
#allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator
41+
#maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k
5142
}
5243
ssl {
53-
#useOpenSsl = true # if OpenSSL should be used instead of JSSE (only the latter can be debugged with -Djava.net.debug=ssl)
54-
#useOpenSslFinalizers = false # if OpenSSL contexts should be freed with Finalizer or if using RefCounted is fine
55-
#handshakeTimeout = 10000 # TLS handshake timeout in millis
56-
#useInsecureTrustManager = true # Use an insecure TrustManager that trusts all server certificates
57-
#enabledProtocols = [] # Array of enabled protocols for HTTPS, if empty use Netty's defaults
58-
#enabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty enable all available ciphers
59-
#sessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default
60-
#sessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h)
61-
#enableSni = true # When set to true, enable Server Name indication (SNI)
44+
#useOpenSsl = true # if OpenSSL should be used instead of JSSE (only the latter can be debugged with -Djavax.net.debug=ssl)
45+
#useOpenSslFinalizers = false # if OpenSSL contexts should be freed with Finalizer or if using RefCounted is fine
46+
#handshakeTimeout = 10000 # TLS handshake timeout in millis
47+
#useInsecureTrustManager = true # Use an insecure TrustManager that trusts all server certificates
48+
#enabledProtocols = [] # Array of enabled protocols for HTTPS, if empty use Netty's defaults
49+
#enabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty enable all available ciphers
50+
#sessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default
51+
#sessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h)
52+
#enableSni = true # When set to true, enable Server Name indication (SNI)
6253
keyStore {
63-
#type = "" # Type of SSLContext's KeyManagers store
64-
#file = "" # Location of SSLContext's KeyManagers store
65-
#password = "" # Password for SSLContext's KeyManagers store
66-
#algorithm = "" # Algorithm used SSLContext's KeyManagers store
54+
#type = "" # Type of SSLContext's KeyManagers store, possible values are jks and p12
55+
#file = "" # Location of SSLContext's KeyManagers store
56+
#password = "" # Password for SSLContext's KeyManagers store
57+
#algorithm = "" # Algorithm used SSLContext's KeyManagers store, typically RSA
6758
}
6859
trustStore {
69-
#type = "" # Type of SSLContext's TrustManagers store
70-
#file = "" # Location of SSLContext's TrustManagers store
71-
#password = "" # Password for SSLContext's TrustManagers store
72-
#algorithm = "" # Algorithm used by SSLContext's TrustManagers store
60+
#type = "" # Type of SSLContext's TrustManagers store, possible values are jks and p12
61+
#file = "" # Location of SSLContext's TrustManagers store
62+
#password = "" # Password for SSLContext's TrustManagers store
63+
#algorithm = "" # Algorithm used by SSLContext's TrustManagers store, typically RSA
7364
}
7465
}
7566
charting {
76-
#noReports = false # When set to true, don't generate HTML reports
77-
#maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports
78-
#useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration.
67+
#maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports
68+
#useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration.
7969
indicators {
80-
#lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary
81-
#higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary
82-
#percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite
83-
#percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite
84-
#percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite
85-
#percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite
70+
#lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary
71+
#higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary
72+
#percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite
73+
#percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite
74+
#percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite
75+
#percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite
8676
}
8777
}
8878
http {
89-
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
90-
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
91-
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
92-
#warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
93-
#enableGA = true # Very light Google Analytics (Gatling and Java version), please support
94-
#pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool
95-
#requestTimeout = 60000 # Timeout in millis for performing an HTTP request
96-
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS")
79+
#fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable
80+
#fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable
81+
#perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable
82+
#warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled)
83+
#pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool
84+
#requestTimeout = 60000 # Timeout in millis for performing an HTTP request
85+
#enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS")
9786
dns {
98-
#queryTimeout = 5000 # Timeout in millis of each DNS query in millis
99-
#maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution
87+
#queryTimeout = 5000 # Timeout in millis of each DNS query in millis
88+
#maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution
10089
}
10190
}
10291
jms {
103-
#replyTimeoutScanPeriod = 1000 # scan period for timedout reply messages
92+
#replyTimeoutScanPeriod = 1000 # scan period for timed out reply messages
10493
}
10594
data {
106-
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)
95+
#writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite)
96+
#utcDateTime = true # Print date-times with the UTC zone instead of the System's default
10797
console {
108-
#light = false # When set to true, displays a light version without detailed request stats
109-
#writePeriod = 5 # Write interval, in seconds
98+
#light = false # When set to true, displays a light version without detailed request stats
99+
#writePeriod = 5 # Write interval, in seconds
110100
}
111101
file {
112-
#bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes
102+
#bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes
113103
}
114104
leak {
115-
#noActivityTimeout = 30 # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening
105+
#noActivityTimeout = 30 # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening
116106
}
117107
graphite {
118-
#light = false # only send the all* stats
119-
#host = "localhost" # The host where the Carbon server is located
120-
#port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
121-
#protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
122-
#rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
123-
#bufferSize = 8192 # Internal data buffer size, in bytes
124-
#writePeriod = 1 # Write period, in seconds
108+
#light = false # only send the all* stats
109+
#host = "localhost" # The host where the Carbon server is located
110+
#port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle)
111+
#protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp")
112+
#rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite
113+
#bufferSize = 8192 # Internal data buffer size, in bytes
114+
#writePeriod = 1 # Write period, in seconds
125115
}
116+
#enableAnalytics = true # Anonymous Usage Analytics (no tracking), please support
126117
}
127-
}
118+
}

0 commit comments

Comments
 (0)