ARC 5Own Runtime OperationsChapters 19–22

Chapter 22 — From Microbenchmark to Production Capacity Evidence

Chapter objective: After this chapter, a developer can select one DSM hot path, fix the JMH environment and parameters, retain raw JSON, and draw a capacity conclusion only under comparable conditions.

Learning objectives

  1. Distinguish benchmark-harness smoke, microbenchmark result, and production capacity.
  2. Select fixtures for Register, Lease, CRDT, ChangeStream, and security.
  3. Record JDK, CPU, parameters, units, and raw result.
  4. Separate throughput, latency distribution, and distributed end-to-end performance questions.

Prerequisites

Case progress

"Can DSM handle the traffic?" is too broad for one measurement. The fulfillment team separates RecordCodec latency, Register get, Lease renew, CRDT apply/merge, ChangeStream overflow, and secure-envelope overhead into named hot paths.

Evidence chain for a capacity conclusion

From a hot-path question to reproducible capacity evidence

The benchmark module contains:

Each fixture answers only the local question in its name.

Smoke run and measurement run

BenchmarkHarnessTest checks request defaults, parameter validation, and JSON structure. A short JMH run proves the harness executes; insufficient warmup, forks, or measurement time makes its numbers unsuitable for a capacity commitment.

Reproducible smoke commands:

cd submodule/dsm
mvn -q -pl dsm-benchmark -am test
mvn -q -pl dsm-benchmark -DskipTests exec:exec \
  -Dbenchmark.include=RegisterGetLatency \
  -Dbenchmark.warmupIterations=0 \
  -Dbenchmark.measurementIterations=1 \
  -Dbenchmark.measurementTimeMs=100 \
  -Dbenchmark.forks=0

This is a CI/teaching smoke configuration rather than a recommended reporting configuration.

Required result-card fields

Field Example
revision DSM 505e7557
environment macOS, JDK 25, CPU/memory, power mode
benchmark full class/method name
fixture parameters payload, entry count, threads
JMH parameters warmup, measurement, forks
mode / unit throughput or sample time; ops/s or ns/op
raw evidence JSON path and SHA-256
interpretation boundary excludes network, business IO, cluster contention

Copying one average discards units, error, percentiles, and run conditions.

From microbenchmark to capacity plan

Microbenchmarks reveal hot-path regressions. Production capacity also includes entity size and key distribution, node count, latency/loss, repair traffic, GC, contention, security overhead, observation backends, and workload peaks. Final load tests use independent processes in a production-like environment.

Counterexample and fault injection

Experiment

Run the harness test and one short smoke. Record environment and parameters in benchmark-run-card.json. The book validates the card fields and does not freeze the short-run score into prose.

Experiment acceptance card

Field Content
Command BenchmarkHarnessTest plus JMH smoke for one named fixture
Input or fault explicit include, warmup, measurement, forks, and environment
Observable result harness writes JSON with mode/unit; command is reproducible
Evidence level E2: component benchmark harness and local smoke
This experiment does not prove Production throughput, P99 SLA, cross-node capacity, peak repair, or cost budget

Review

Next

Chapter 23 starts Arc 6 with a real TCP port and Redis client to observe DSM replication, repair, and protocol boundaries as E4 evidence.