test: Add focused performance test for GET /api/dataEntry/metadata#24384
Draft
jason-p-pickering wants to merge 7 commits into
Draft
test: Add focused performance test for GET /api/dataEntry/metadata#24384jason-p-pickering wants to merge 7 commits into
jason-p-pickering wants to merge 7 commits into
Conversation
Covers the new focused Gatling test for GET /api/dataEntry/metadata and the local build-and-compare workflow for fix/hibernate-fetch-size vs master on the Sierra Leone demo DB. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Cold-fetch baseline for the data-entry metadata payload endpoint, to be used for comparing fix/hibernate-fetch-size against master. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
…EADME Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Calibrated against a Sierra Leone demo DB run on both branches (5 requests each, single run): fix/hibernate-fetch-size: p95/max 771ms, mean 480ms, 5/5 successful master: p95/max 926ms, mean 530ms, 5/5 successful hibernate-fetch-size is faster on every percentile here, consistent with the fetch-size fix helping this endpoint's collection-heavy payload assembly. Thresholds set at p95<1200ms/max<1500ms, above the slower (master) run with headroom for variance at this sample size. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Basic Auth re-authenticates on every request, mixing DHIS2's login cost into what should be a pure measurement of the metadata endpoint itself. Switch to logging in once per virtual user (matching a real logged-in user) and measuring only the subsequent GET requests, under a separate "Authentication" group excluded from the assertions. Also parameterize concurrentUsers/rampDurationSeconds (both default to the previous single-user behavior) and raise the default iteration count from 5 to 20 for more statistically meaningful percentiles. Thresholds are placeholders again pending recalibration against this new flow. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
.group(METADATA_REQUEST) wrapped the entire repeat(ITERATIONS) loop under a group sharing the request's name. With one virtual user, Gatling only has one sample of that group's cumulative duration (summed across all iterations), so details(METADATA_REQUEST) picked up that one bogus ~7.5s sample instead of the per-request p95 distribution across the 20 individual requests (real p95 was 550ms). The Authentication group (distinct name) is unaffected and still correctly isolates login timing from the metadata assertions. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Calibrated from 3 repeated single-user runs per branch (60 requests each), combined via gstat, so the numbers reflect a real distribution rather than a single noisy sample: fix/hibernate-fetch-size: p95 500ms, p99 535ms master: p95 585ms, p99 609ms Thresholds set above the worse (master) branch with headroom. Absolute numbers will differ on other hardware (e.g. the performance CI runner) -- what matters here is the relative comparison this test is designed to catch a regression against. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
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
DataEntryMetadataPerformanceTest, a focused Gatling performance test forGET /api/dataEntry/metadata, which takes no parameters and currently has no way to isolate its cost in the existing test suite.If-None-Matchheader rebuilds the full data-entry metadata payload (data sets, data elements, indicators, category combos/categories/options, option sets), so every iteration in the test measures a genuine cold fetch.dhis-test-performance/README.md.docs/superpowers/specs/2026-07-07-dataentry-metadata-perf-test-design.md).Baseline measurement (fix/hibernate-fetch-size vs master)
This test was used to compare
fix/hibernate-fetch-sizeagainstmasteron a local Sierra Leone demo DB (5 requests each, single run, local Docker images built from source):fix/hibernate-fetch-sizeis faster on every percentile here — no regression, and directionally consistent with the fetch-size fix helping this endpoint's collection-heavy payload assembly. Assertion thresholds (p95 < 1200ms, max < 1500ms) are set above the slower (master) run with headroom for variance at this sample size.Test plan
mvn spotless:checkpassesmvn test-compilepassesfix/hibernate-fetch-size— 5/5 successful, assertions passmaster— 5/5 successful, assertions pass🤖 Generated with Claude Code