-
Notifications
You must be signed in to change notification settings - Fork 332
Add throughput benchmark for petclinic load testing #11098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
bm1549
wants to merge
3
commits into
master
Choose a base branch
from
worktree-brian.marks+memory-benchmark
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| tools/ | ||
| results/ | ||
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,76 @@ | ||
| # Throughput Benchmark | ||
|
|
||
| Measures tracer throughput overhead under load at varying heap sizes using spring-petclinic and JMeter. | ||
|
|
||
| Runs petclinic with `GET /owners/3` (DB-backed endpoint) at heap sizes from 256m down to 64m, comparing no-agent baseline vs candidate agent. | ||
|
|
||
| ## Quick start | ||
|
|
||
| ```bash | ||
| # Full run: baseline + candidate at all heap sizes | ||
| ./run.sh | ||
|
|
||
| # With a specific agent jar | ||
| ./run.sh --agent /path/to/dd-java-agent.jar | ||
|
|
||
| # Quick test with fewer heap sizes and shorter durations | ||
| ./run.sh --heap-sizes 256,128,64 --warmup 15 --measure 30 | ||
|
|
||
| # With JFR profiling | ||
| ./run.sh --jfr | ||
|
|
||
| # Only run candidate (skip baseline if you already have baseline numbers) | ||
| ./run.sh --skip-baseline | ||
|
|
||
| # Test a specific optimization with extra agent opts | ||
| ./run.sh --agent-opts "-Ddd.appsec.enabled=false -Ddd.profiling.enabled=false" | ||
| ``` | ||
|
|
||
| ## What it does | ||
|
|
||
| For each heap size (default: 256, 192, 128, 96, 80, 64 MiB): | ||
|
|
||
| 1. Starts petclinic with `-Xms<N>m -Xmx<N>m` (no agent) | ||
| 2. Runs JMeter with 8 threads for warmup + measurement | ||
| 3. Records stabilized throughput (measurement window only) | ||
| 4. Repeats with `-javaagent:dd-java-agent.jar` | ||
| 5. If petclinic OOMs or fails to start, records "OOM" | ||
|
|
||
| ## Output | ||
|
|
||
| ``` | ||
| Heap Baseline Candidate Delta | ||
| ------ ----------- ----------- ----------- | ||
| 256m 22400 req/s 19500 req/s -12.9% | ||
| 192m 21750 req/s 19000 req/s -12.6% | ||
| 128m 21500 req/s 14750 req/s -31.4% | ||
| 96m 16750 req/s 13000 req/s -22.4% | ||
| 80m 16350 req/s 11250 req/s -31.2% | ||
| 64m 15000 req/s 7500 req/s -50.0% | ||
| ``` | ||
|
|
||
| Results are also saved as CSV in `results/<timestamp>/summary.csv` with per-run JTL files and logs. | ||
|
|
||
| ## Dependencies | ||
|
|
||
| Auto-downloaded on first run: | ||
| - **JMeter 5.6.3** → `tools/apache-jmeter-5.6.3/` | ||
| - **spring-petclinic 3.3.0** → `tools/spring-petclinic/` (built with Maven) | ||
| - **dd-java-agent** → auto-detected from `dd-java-agent/build/libs/` or built via Gradle | ||
|
|
||
| Requires: Java 17+, Python 3 (for JTL parsing), curl, git. | ||
|
|
||
| ## Comparing versions | ||
|
|
||
| To compare two tracer versions, run separately and diff the CSVs: | ||
|
|
||
| ```bash | ||
| # Run with release version | ||
| ./run.sh --agent /path/to/dd-java-agent-1.61.0.jar --output ./results/v1.61.0 | ||
|
|
||
| # Run with candidate | ||
| ./run.sh --agent /path/to/dd-java-agent-SNAPSHOT.jar --output ./results/candidate | ||
|
|
||
| # Compare | ||
| paste -d, results/v1.61.0/summary.csv results/candidate/summary.csv | ||
| ``` |
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Placing these in a "memory" folder seems off to me.
The intent of running at multiple memory settings is to simulate how the application behaves under load relative to available resources, so I don't think of this as a memory benchmark.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moved it to
benchmark/throughput/petclinic/.