Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions benchmark/throughput/petclinic/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
tools/
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor Author

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/.

results/
76 changes: 76 additions & 0 deletions benchmark/throughput/petclinic/README.md
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
```
Loading
Loading