Skip to content

Local performance and capacity testing

The repository performance harness measures local Python traffic through one Collector composition, workload, seed, and host/Docker resource envelope. It separately attests a supplied candidate wheel, source state and dependency lock; Collector trials do not execute that wheel. A result is not a production SLO, vendor-backend benchmark, multi-node capacity claim, or representative Consumer workload.

This Capacity Evaluation is the telemetry-delivery adapter built on the reusable statistics in telemetry.performance. Consumer-owned model and algorithm evaluation uses the separate performance evaluation library; it does not require Docker, OTLP, or the Collector evidence schema.

Commands

Prerequisites are the normal locked development environment, a running Docker engine whose CPU and memory envelope can be inspected, the pinned images in collector/images.env, and at least 2 GiB of free disk. No vendor endpoint or credential is read or contacted.

make perf-smoke
make perf-capacity PERF_SCENARIO=stateless-traces-grpc
make perf-capacity PERF_SCENARIO=all
make perf-capacity PERF_SCENARIO=local-file-balanced-grpc
make perf-runtime PERF_RUNTIME_MODE=disabled PERF_RUNTIME_SIGNAL=balanced

perf-smoke sends low-rate balanced trace, metric, and log traffic through the base Collector over OTLP/gRPC to the benchmark-only counting sink. It is a wiring and calculation check, not a capacity claim. perf-capacity is opt-in. It starts at PERF_INITIAL_RATE, doubles until failure or PERF_MAX_RATE, refines the passing/failing bracket to 5%, then alternates five independent cold-start confirmations of the selected and immediately lower rates. Each capacity measurement has 30 seconds of warmup, 120 seconds of measurement, and a bounded 30-second drain.

The supported stateless scenario names are:

  • stateless-traces-grpc and stateless-traces-http;
  • stateless-metrics-grpc and stateless-metrics-http;
  • stateless-logs-grpc and stateless-logs-http; and
  • stateless-balanced-grpc and stateless-balanced-http.

all selects every stateless and local-file signal/transport cell. Fan-out, persistent-queue, and routed tail-sampling capacity cells remain distinct follow-on scenario implementations. The supported local-file cells use the same traces, metrics, logs, and balanced suffixes with the local-file- prefix (for example, local-file-balanced-http). They compose the supported bounded local JSONL capture backends with the benchmark counting sink. The sink is the exact item-accounting oracle; the retained local-file metadata records only per-file byte totals and never keeps telemetry bodies in the evidence directory. Existing make test-docker verification still covers fan-out, persistent restart/isolation, and whole-trace functional contracts.

Capacity traffic uses nominal-v2, balanced-three-signal-v2 or safety-ceiling-v2 workload shape. These declarations drive homogeneous OTLP batches of up to 128 items, with a partial final batch per signal. Balanced traffic interleaves equal intended item arrivals across signals, then batches each signal separately. All items retain unique synthetic identity and their own intended arrival time. Nominal items have ten signal attributes and a 512-byte minimum serialized protobuf item size. Safety-ceiling items use 64 attributes/16,384-byte targets for spans and logs, and 16 attributes/3,072-byte targets for metric points, with string values bounded to the respective Safety Floor. The six shared resource attributes are distinct from those counts. Workload scalar attribute/byte declarations are per-signal maxima; explicit per-signal maps define the shape actually generated. Byte targets exclude the shared resource/scope/request envelope and transport framing. Protobuf integer and length-prefix widths vary; bounded synthetic padding meets a minimum target rather than asserting an exact wire size. The checksummed observations artifact retains generator-wire-shape/v1 metadata with exact per-signal item/request byte histograms, counts, minima, maxima and totals, plus the declaration used to generate them. No serialized telemetry bodies are retained in that metadata. The builder checks declaration and byte/count conservation; missing current-shape evidence is incomplete. Item scheduled-to-ack latency includes batch formation. Generator scheduling lateness starts at the last intended arrival in each batch, preserving the distinction between batching and dispatch lag. Legacy v1 workload files remain readable but cannot generate current traffic. The new workload ID/hash prevents comparisons with the former one-item evidence. Advanced tail/soak cells remain follow-on work.

Traffic controls reject nonfinite/Boolean values, limit each emission phase to 300 seconds and 500,000 items, and allow integer concurrency 1–64. Resource declarations reject nonfinite values, limit CPU values to 64, wall declarations to 3600 seconds, and memory/disk to integer MiB up to 65,536. Collector memory is at least 64 MiB. Requested warmup, measurement and drain durations must fit the wall declaration minus its 25-second cleanup reserve before acquisition. Collector Docker CPU/memory flags use the declaration. Its memory limiter uses an 80% hard limit and 20% spike allowance, and the health soft-limit threshold is their difference. Queue admission precedes payload construction and retains at most one outstanding request per configured worker. Capacity searches validate finite bounded rates/durations before the first trial and require integer confirmation counts from 5 to 20; each actual trial retains the separate 500,000-item bound. CLI trial counts are integers 1–50. On supported POSIX main-thread execution, each owned trial runs in a fresh spawn process with a process group established before acquisition. The parent uses the declared wall duration minus 25 seconds as the execution deadline, then kills/verifies the group and reaps its root if needed. Parent-owned UUID-derived Docker names allow a separate bounded cleanup attempt after a stalled or interrupted child; cleanup stays within the remaining wall budget. The control channel carries only one-byte statuses; completed reports are loaded from retained files. SIGINT is preserved, SIGTERM becomes a fixed caller-abort exception, and prior signal handlers are restored. Aborted attempts retain checksummed inconclusive raw evidence, including a fixed resource-limit-exceeded reason for observed disk/queue breaches. The parent polls total logical bytes in the complete output directory (including earlier replicates) and the 2 GiB free-space floor before startup, between control polls with at most 100 ms waiting, and after worker completion. Inspection rejects links and trees larger than 4096 entries. Collector sampling during warmup, measurement and drain latches observed full queues in empty fixed markers; the parent stops even a stalled sender when it observes a marker. Final metrics also reject a full queue. Disk and queue checks detect sampled breaches; they cannot exclude transient overshoots between observations and do not implement a hard filesystem quota. Docker BlockIO is I/O traffic, not disk occupancy. Generator/sink CPU/memory quotas remain unavailable for the host Python processes; raw v5 records this explicitly and makes these attempts nonqualifying for constrained capacity.

make perf-runtime measures one public TelemetryRuntime mode and signal workload. Its normal configuration is ten repeated 15-second cold-runtime runs; repetition does not establish experimental independence. Reports separate emission elapsed time, sampled public-call durations, force_flush, shutdown, and total measured lifecycle time, all in nanoseconds. Runtime construction is excluded from that total. CLI mode and signal are required (the Make target supplies validated defaults). Duration must be finite and positive, at most 300 seconds per run; repetitions are integers 1–100, with at most 3600 seconds of requested emission time in total. Validation precedes runtime construction. Empty or short scheduling windows retain empty/short timing samples and still flush/shut down. disabled and in-memory need no Collector. For grpc or http/protobuf, pass a loopback-only running Collector endpoint with PERF_RUNTIME_ENDPOINT; those modes exercise the same public facade, while the stateless capacity scenarios retain scheduled-to-ack delivery evidence. The runtime harness rejects remote hosts and credentials before runtime construction. It accepts literal IPv4 loopback addresses and IPv6 ::1; exact localhost is normalized to 127.0.0.1 without DNS lookup. Use the local Collector directly, without a redirecting proxy. This harness policy does not restrict remote endpoints in production TelemetryConfig. In-memory capture retains only the latest operation and observation, independently of the first-10,000 timing sample limit. It still pays schema/context/lock, record-allocation and eviction costs; it does not measure unbounded test-recorder history or export. Reports disclose adapter and capture scope for each mode. Shared RecordingTelemetry remains a full-history contract-test recorder. The timing population is explicitly the first up to 10,000 emission calls per repetition, with omitted call counts retained. It does not describe later-call latency or a whole-run percentile population. Runtime overhead reports are local observations and do not replace the paired fixed-budget evidence owned by the compatibility qualification.

Evidence

Outputs are written under .build/performance/<run-id>/<scenario>/:

  • raw-<uuid>.json is a checksummed replicate finalized after parent cleanup;
  • observations-<uuid>.json retains mergeable latency histograms, one-second resource/self-metric samples, and aggregate sink observations; and
  • summary.json is recomputed from the raw replicates for a capacity search.

The raw schema is benchmarks/schema/performance-raw-v5.schema.json; the normalized summary schema is benchmarks/schema/performance-summary-v5.schema.json. Retained v1/v2/v3/v4 schemas remain available for legacy evidence. Capacity qualification requires unique run IDs and distinct Docker-inspected Collector instances with run-bound startup timestamps and zero startup restarts, plus validated constraint enforcement. Closed records retain declared/applied wall, disk, generator CPU/memory and sink CPU/memory limits with status and source. Missing controls, invalid sources, applied limits above declarations and unavailable controls contradicting invented applied values are rejected. Any unavailable control makes the result inconclusive with constraints_unavailable. The current host-process runner has no generator/sink or hard disk quota, so it cannot select constrained capacity, even with complete delivery measurements. Only the parent records wall enforcement after verified completion and cleanup. Summary v5 retains run-bound controls and includes them in comparison identity; legacy raw reports remain readable but cannot qualify current capacity. Summary comparison checks run/curve coverage and rejects unavailable controls beneath a selected capacity, even with a recomputed checksum. Synthetic quota fixtures qualify analysis behavior only. Wheel/source/lock identity is attestation: supplied candidate wheels are explicitly attested-not-executed by Collector trials. Actual execution records identify the local Python generator and sink by source digest, Python version and grpcio/protobuf/opentelemetry-proto versions. Only the Collector retains an image identity; unused telemetrygen images do not describe generation. Execution participates in summary comparison identity and is checked independently of checksum. The explicit latency plan designates an initial low-load rate. A reference-establishment trial at that rate can pass only with complete eligible controls, at least 10,000 latency items and all non-relative-latency gates passing. It has no reference percentile of its own. Subsequent capacity trials retain that distinct source report and checksum; validation recomputes its classification, percentile and full execution/candidate compatibility. Caller scalars and same-point percentiles cannot establish a reference. Missing source evidence makes otherwise eligible trials inconclusive. Later high-load or failed observations cannot set the reference, and failed points remain retained. Raw v5 retains closed capacity-experiment/v1 acquisition records for warmup and environment stability, generator CPU and throttling, and sink CPU, RSS and headroom. Missing acquisition is explicitly unavailable with a null value and makes a trial inconclusive. Health projections must match these records. The current native backend has no acquisition for these seven controls; the parent reconstructs unavailable records from that backend. Actual generator CPU time and elapsed time remain observations, without implying normalized headroom. Acquired sink headroom requires CPU and RSS observations within the declared or applied memory bound. Summary v5 retains run-bound experiment evidence and rejects selected capacity backed by unknown controls. Summary v5 retains run-bound reference evidence and independently verifies it beneath selected capacity. Coverage assumptions explicitly retain independent representative trial sampling for the median bootstrap, independent residuals for approximate trend intervals, and a bucketed p99 point reference without ratio coverage guarantees. Nominal 95% intervals have no simultaneous or adaptive search coverage guarantee. These checks do not prove experimental independence; scheduling remains an experimental assumption. Raw v5 preserves baseline/final metric acquisitions and per-sample metric/Docker acquisitions, with acquired, unavailable, parse-error or stale status and numeric values distinct from missing values. Required families are receiver refusal, exporter sent/enqueue-failure/send-failure, queue size and positive queue capacity. Every resource sample needs CPU, RSS, disk and network observations. Absent error families are unknown, even when the Collector does not publish a zero-valued series. Docker readings older than three seconds, missing families, parse failures, sampling gaps over 4.5 seconds (including the initial and trailing window) and observed counter decreases make measurement coverage incomplete. Docker acquisition retains its age and the last sample retains sampling-end elapsed time. Health fields derived from incomplete coverage are null; the trial is inconclusive. The validator independently checks retained acquisition coverage and sample projection before accepting completeness. Only v3 evidence can qualify current capacity summaries; legacy evidence remains readable. scripts/validate_performance_report.py independently validates identities, forbidden secret-like fields, finite/bounded values, count conservation, classification, checksums, confidence intervals, and matching-environment comparisons. The current scripts/qualify_platform.py schema 2 remains unchanged: performance evidence is informational until a reviewed controlled baseline explicitly adopts a new qualification schema.

Every raw result distinguishes pass, fail, and inconclusive. Generator scheduling/CPU limits, sink limits, environmental change, missing measurements, interruption, or incomplete cleanup are inconclusive; they are never relabeled as Collector passes or failures. Product failures include unexplained loss, refusals, enqueue/send failures, queue pressure, memory/CPU exhaustion, and the scheduled-to-ack latency guard.

Safety and cleanup

The runner uses deterministic synthetic platform vocabulary, unique container/network names, loopback-only ingress ports, a one-CPU/640-MiB/256-PID Collector boundary, bounded request and item counts, a disk preflight, and a finally cleanup path. The counting sink retains counts, unique benchmark item IDs, request bytes, and source timing only; it never stores telemetry bodies, headers, hostnames, usernames, environment values, or arbitrary error strings.

If interrupted, no normalized summary is accepted. Inspect Docker only if cleanup itself failed:

docker ps -a --filter name=telemetry-perf-
docker network ls --filter name=telemetry-perf-

Remove only the uniquely named resources reported by the failed run. Retain failed and inconclusive raw points when cleanup succeeded; first failure is part of the capacity curve and is never discarded. Percentiles are derived from retained mergeable histograms. A p99 is unsupported below 10,000 items and a capacity point without enough observations is inconclusive, never padded with false precision.