Checkpoint Lab — HTTP Request Samplers, Defaults, Headers, Cookies, and Cache Managers
Complete the HTTP foundations by building a small authenticated-looking journey that uses only synthetic loopback state. Two JMeter users receive independent server-issued cookies, access their own sessions, exercise cache and redirect behavior, and produce a lean evidence set that is safe to carry into later load chapters.
Learning objectives
- Build a reviewable HTTP component tree with centralized loopback defaults and HttpClient4.
- Prove server-issued cookie sessions remain isolated per JMeter thread.
- Predict and verify cache-driven target request-count differences.
- Observe redirect and persistent-connection behavior without conflating it with browser rendering.
- Run a load-evidence copy with response bodies/headers disabled.
-
Package JMX, JTL,
jmeter.log, server events, settings, and validity notes into one evidence packet.
1. Assumptions and hard safety limits
| Item | Checkpoint baseline |
|---|---|
| JMeter | Apache JMeter 5.6.3. |
| Java | Java 17 JDK lab baseline; JMeter 5.6.3 requires Java 8+. |
| HTTP implementation | HttpClient4 explicitly selected in HTTP Request Defaults. |
| Plugins | None. |
| Target | http://127.0.0.1:8000 only. |
| Users | 2 threads × 1 loop. |
| Journey | Session → Profile → Cache First → Cache Second → Redirect. |
| Page resources | Separate one-thread optional evidence step; not required in the two-user session run. |
| Maximum target traffic | Under 24 HTTP requests for any checkpoint run. |
| Artifacts |
JMX, lean JTL, jmeter.log, server-events JSONL,
stats, run manifest, validity note.
|
2. Prepare the workspace and fixture
jmeter-ch05-checkpoint/
├── fixtures/
│ └── http_fixture.py
├── plans/
│ ├── checkpoint-debug.jmx
│ └── checkpoint-load.jmx
├── tools/
│ └── analyze_jtl.py
├── evidence/
│ ├── run-manifest.txt
│ ├── predictions.txt
│ └── validity.txt
└── results/
└── checkpoint-001/
Start a fresh fixture with a fresh event log:
python fixtures/http_fixture.py --log results/checkpoint-001/server-events.jsonl
curl --fail --silent http://127.0.0.1:8000/health
curl --fail --silent http://127.0.0.1:8000/stats
3. Build the checkpoint tree
Test Plan — Chapter 05 Checkpoint
└── Thread Group — 2 users × 1 loop
├── HTTP Request Defaults
│ ├── Implementation: HttpClient4
│ ├── Protocol: http
│ ├── Server: 127.0.0.1
│ ├── Port: 8000
│ ├── Connect timeout: 1000 ms
│ └── Response timeout: 2000 ms
├── HTTP Header Manager
│ ├── Accept: application/json
│ └── X-Lab-Client: devops-academy-ch05
├── HTTP Cookie Manager — standard; no manual cookies
├── HTTP Cache Manager — Cache-Control/Expires ON; max 100
├── POST Session — /session
│ └── HTTP Header Manager — Content-Type: application/json
├── GET Profile — /profile
├── GET Cache First — /cache
├── GET Cache Second — /cache
├── GET Redirect — /redirect; Follow Redirects ON
└── View Results Tree — DEBUG COPY ONLY
Use KeepAlive on all HTTP samplers. Keep Redirect Automatically off.
4. Write predictions before execution
- Two POST Session requests create two distinct synthetic session cookies.
- Each Profile request should carry the cookie stored by that thread and return HTTP 200.
- Each thread has its own Cache Manager state. The first Cache GET per user should populate that user's cache; the second may be satisfied from that user's fresh cache without a second target hit.
-
Each Redirect sampler should cause a
/redirectrequest followed by a/finalrequest because Follow Redirects is enabled. - Client ports may show connection reuse within a user's sequence, but exact reuse is an observation rather than a required pass/fail condition.
5. Bounded debug verification
Run checkpoint-debug.jmx once in GUI mode only. In View
Results Tree:
- inspect Session response Set-Cookie and synthetic session JSON;
- verify Profile is HTTP 200 rather than 401;
- inspect Cache First/Second behavior and server counters;
- inspect Redirect parent/children;
- record request/response metadata needed to explain the run, then close/disable the listener.
Do not retain screenshots containing real credentials—there are none in this fixture by design.
6. Prove per-thread state from server evidence
Inspect server-events.jsonl. You should see two
session-creation POSTs and two Profile GETs. Profile events should
contain session cookies issued by earlier Session responses. The
exact request interleaving can differ because two threads run
concurrently.
Query /stats and record
sessions_created=2. Cache path counts may be lower than
the number of Cache sampler executions because fresh Cache Manager
entries can avoid target calls.
7. Create the lean load-evidence copy
Save checkpoint-load.jmx with View Results Tree
disabled. Do not add Debug Sampler or response-saving listeners.
Restart the fixture/event log so evidence has a clean baseline.
8. Run from CLI
jmeter -n -t plans/checkpoint-load.jmx -l results/checkpoint-001/results.jtl -j results/checkpoint-001/jmeter.log -Jjmeter.save.saveservice.print_field_names=true -Jjmeter.save.saveservice.connect_time=true -Jjmeter.save.saveservice.response_data=false -Jjmeter.save.saveservice.response_data.on_error=false -Jjmeter.save.saveservice.requestHeaders=false -Jjmeter.save.saveservice.responseHeaders=false -Jjmeter.save.saveservice.samplerData=false
python tools/analyze_jtl.py results/checkpoint-001/results.jtl
PowerShell:
jmeter.bat -n `
-t plans\checkpoint-load.jmx `
-l results\checkpoint-001\results.jtl `
-j results\checkpoint-001\jmeter.log `
-Jjmeter.save.saveservice.print_field_names=true `
-Jjmeter.save.saveservice.connect_time=true `
-Jjmeter.save.saveservice.response_data=false `
-Jjmeter.save.saveservice.response_data.on_error=false `
-Jjmeter.save.saveservice.requestHeaders=false `
-Jjmeter.save.saveservice.responseHeaders=false `
-Jjmeter.save.saveservice.samplerData=false
python tools\analyze_jtl.py results\checkpoint-001\results.jtl
9. Verification checklist
- JTL contains the expected sampler labels and no unexpected failures.
- Profile samples return HTTP 200 for both users.
- Server event log proves two independent server-issued session cookies were later presented.
- Server cache path count is interpreted in light of per-thread Cache Manager state, not assumed from sampler count alone.
-
Redirect target log shows both
/redirectand/final. -
jmeter.logcontains no unexpected engine/configuration errors. - JTL does not contain response bodies/request headers/response headers.
- Generator CPU/memory/network observation shows this tiny run had safe headroom.
10. Optional one-thread embedded-resource evidence
Run a separate one-thread plan with GET Page first with embedded
resources off, then on. With it on and concurrent pool off, the
server event log should add requests for /asset.css,
/asset.js, and /pixel.svg.
Record explicitly that the script file was downloaded but not executed. This avoids contaminating the main cookie/cache checkpoint with a different request population.
11. Run manifest
run_id=chapter05-checkpoint-001
jmeter=5.6.3
java=17
http_implementation=HttpClient4
target=http://127.0.0.1:8000
threads=2
loops=1
cookie_manager=standard; no manual cookies
cache_manager=Cache-Control/Expires enabled; max=100
redirect=Follow Redirects ON; Redirect Automatically OFF
keep_alive=ON
embedded_resources=OFF in main checkpoint
jtl=lean CSV; bodies/headers disabled; connect_time enabled
abort=target mismatch, external URL, unexpected 5xx, unsafe generator pressure
12. Required evidence packet
| Artifact | Why it matters |
|---|---|
| Debug/load JMX | Exact component tree and authoring-versus-load instrumentation. |
| Run manifest | Resolved HTTP/client/session/cache assumptions. |
| Bounded debug metadata | Set-Cookie/Profile/redirect observations without production secrets. |
| Lean JTL | Sample timing/status/bytes/connect-time evidence. |
jmeter.log |
JMeter engine/runtime diagnostics. |
| Server event JSONL | Independent cookies, paths, headers, client-port, redirect/cache network evidence. |
| Fixture stats | Total/path/session/connection summary. |
| Generator observation | Confirms injector headroom for the tiny run. |
| Validity note | Prevents protocol semantics from being misreported as production capacity/browser performance. |
13. Validity statement
14. Cleanup and rollback
- Stop the local Python fixture.
- Keep the checkpoint artifacts until review is complete.
- Remove/disable View Results Tree before carrying the JMX forward.
- Do not carry synthetic cookies as manually defined Cookie Manager entries.
- No production target, real credential, certificate, database, remote engine, plugin, container, or system-wide network/JVM setting was changed.
15. What Chapter 05 adds to the operating model
Chapter 04 defined when users act. Chapter 05 adds a protocol/session contract: resolved destination, HTTP client implementation, request headers, server-issued cookie lifecycle, per-user cache behavior, redirect policy, connection behavior, embedded-resource scope, and result-retention policy.
Chapter 06 builds on this by separating JMeter variables, JMeter properties, Java system properties, and environment-specific configuration so the same HTTP journey can move safely between authorized environments without hard-coded values or shared mutable state.
Knowledge check
What evidence proves the two virtual users did not share one manually configured session?
The server created two distinct cookies, and subsequent Profile events carried server-issued session values while the Cookie Manager contained no manual session cookie.
Why can there be fewer /cache target events than Cache sampler executions?
Each thread's Cache Manager can satisfy a fresh repeated GET from its own cache, so sampler execution does not always imply a network request.
Why are request/response headers omitted from the load JTL?
They are unnecessary for the routine performance evidence here, add artifact cost, and can expose sensitive protocol data in real tests.
Why is embedded-resource evidence kept in a separate optional run?
It changes the HTTP request population and could obscure the main cookie/cache/session comparison.
What is the natural bridge to Chapter 06?
The HTTP plan now needs portable environment values and per-thread/runtime state without hard-coded hosts or confusing variables with global properties.
Official references and version notes
- Component Reference — current HTTP Request, HTTP Request Defaults, HTTP Header Manager, HTTP Cookie Manager, HTTP Cache Manager, redirect, keep-alive, and embedded-resource semantics.
- Elements of a Test Plan — scope and execution architecture around samplers and configuration elements.
- Properties Reference — current CSV/JTL save fields and defaults such as response/request header retention and connect time.
- Functions and Variables — thread-local runtime values and function boundaries.
- Getting Started — GUI authoring/debugging versus CLI load execution.
- Best Practices — lean load generation and result/listener guidance.
- Apache JMeter downloads — current production release and release-specific Java requirement.
Version-sensitive statements were rechecked against current Apache JMeter primary documentation on 2026-09-04. The course baseline remains Apache JMeter 5.6.3 with a Java 17 JDK for labs and no third-party plugins; JMeter 5.6.3 itself requires Java 8+. HTTP labs explicitly select HttpClient4 in HTTP Request Defaults rather than relying on inherited/default implementation selection. Current docs state that response cookies handled by one HTTP Cookie Manager are stored per JMeter thread, while manually configured cookies are shared by threads. HTTP Cache Manager keeps a separate cache per virtual-user thread. Redirect Automatically hides intermediate redirects from JMeter and should only be used for GET/HEAD; Follow Redirects lets JMeter follow the chain and retain redirect child samples while the parent elapsed/bytes include the chain. Use KeepAlive is controllable with the Apache HttpComponents implementation. Embedded-resource retrieval parses HTML/CSS references and sends additional HTTP requests; it does not execute a browser DOM, render pixels, run application JavaScript, or reproduce Selenium/browser behavior.
Keep the academy open
Support free, practical DevOps education.
Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0
Send only Ethereum/ERC-20 compatible assets to this
address.