Add Gatling load tests for the articles API with SLO assertions - #294
Open
devin-ai-integration[bot] wants to merge 1 commit into
Open
devin-ai-integration[bot] wants to merge 1 commit into
devin-ai-integration[bot] wants to merge 1 commit into
Conversation
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a Gatling load test for the articles REST API plus
PERFORMANCE_REPORT.mdwith the measuredresults. No application code changed.
The simulation lives in a standalone Gradle build (
load-tests/, ownsettings.gradle) soGatling's Scala/Netty stack, the extra source set and the plugin's Gradle 8 deprecations stay out of
the application build, which keeps
./gradlew buildand the JaCoCo gate untouched. Run it with./gradlew -p load-tests gatlingRun-io.spring.gatling.ArticlesLoadSimulation.Design points that aren't obvious from the code:
constantUsersPerSec(30)therefore is 30req/sec, and a slow server queues rather than self-throttling (a closed model would silently
reduce the offered rate and hide saturation).
HttpClient(ConduitApiClient) in the simulation constructor, so JWT issuance and JIT warm updon't pollute the percentiles.
during setup, sized from the run parameters:
randomSwitch: 80 % reads (split 50/50 betweenGET /articlesandGET /articles/{slug}), 15 %POST /articles, 5 %DELETE /articles/{slug}. Measured split over9,000 requests: 40.0 / 39.6 / 15.2 / 5.3 %.
endpoint) and error rate < 1 %, so
gatlingRunexits non-zero on a breach and the simulation canbe dropped into a pipeline as a performance gate as is. Every knob (
rate,durationSeconds,weights, thresholds,
baseUrl, credentials) is a-Pproperty.Results (30 req/sec, 5 minutes)
PASS — 9,000 requests, 0 failures, global p50 5 ms / p95 9 ms / p99 10 ms, ~20x margin on the
p95 SLO. A capacity probe puts the knee at ~240 req/sec (p95 65 ms); at 300 req/sec throughput stops
tracking the injected rate and latency goes to tens of seconds with refused connections.
PERFORMANCE_REPORT.mdhas the per-endpoint percentiles, the capacity table, and the optimisationbacklog (the redundant five-way-join
countArticleon every list page, the three extra round tripsin
ArticleQueryService.fillExtraInfo, missing indexes sinceV1__create_tables.sqldeclaresprimary keys only, SQLite WAL/write serialisation, and no effective statement timeout —
default-statement-timeout=3000is 3000 seconds). None are required to meet the SLO, so none wereimplemented here.
Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/67a0af5b5df34bb48b0f89952124d574