Repository navigation
Conversation
Implements the benchmarking requirements of the OpenTelemetry spec's "Performance Implications" section (mongodb/specifications#1986): - OtelBenchmarkSuite runs the DriverBench "Small doc insertOne" and "Find one by ID" tasks, sync and Reactive Streams, under one tracing configuration per JVM: off, api-only (ObservationRegistry with no handlers), sdk-ratio (OTel SDK, 1% TraceIdRatioBased sampler) and sdk-always (alwaysOn). The harness installs the SDK; no exporter or span processor is installed. A verify mode counts spans per operation. - InstrumentedBenchmarkRunner records wall time, process CPU time and GC time per iteration, reporting MB/s and CPU-per-op excluding GC. - otel-bench.py runs the configurations interleaved with rotated order across repetitions and writes a report; a pre-OTel baseline worktree can be included for the spec's one-time comparison. - otel-compare-langs.py and otel-compare-runs.py produce cross-language and before/after tables. New benchmark-only dependencies (micrometer-tracing-bridge-otel, opentelemetry-sdk-trace via opentelemetry-bom) are declared in the version catalog and used only by driver-benchmarks. Run: ./gradlew :driver-benchmarks:runOtel -Dorg.mongodb.benchmarks.data=... -Dorg.mongodb.benchmarks.output=... -Dorg.mongodb.benchmarks.otel.config=sdk-ratio
…rgreen Runs the DRIVERS-3620 benchmark on the existing perf variant alongside perf-task and perf-netty-task: a standalone v8.0-perf server, the four tracing configurations interleaved with rotated order (3 repetitions by default via OTEL_BENCH_REPS), and upload through send-dashboard-data. otel-bench.py gains --dashboard, which writes results.json in the dashboard shape: one series per configuration/API/task with MB/s and CPU per op, plus throughput loss and added CPU relative to `off` as metrics of their own, as the spec asks drivers to record.
This branch has not been deployed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
JAVA-6303
Benchmark harness for the OpenTelemetry spec's "Performance Implications" section (mongodb/specifications#1986, DRIVERS-3620). Draft: for discussion of method and the Java configuration mapping before this is wired into Evergreen.
What it adds
OtelBenchmarkSuite(driver-benchmarks/.../otel/): runs DriverBench "Small doc insertOne" and "Find one by ID", sync and Reactive Streams, under one tracing configuration per JVM, selected by-Dorg.mongodb.benchmarks.otel.config:off: noObservabilitySettings(baseline)api-only:ObservationRegistry.create()with no handlers; Micrometer short-circuits to a no-op observation, so the driver runs its instrumentation code but nothing recordssdk-ratio: OTelSdkTracerProviderwithtraceIdRatioBased(0.01), bridged viaDefaultTracingObservationHandler, no exporter or processorsdk-always: same withalwaysOn()InstrumentedBenchmarkRunner: wall time, process CPU time and GC time per iteration; reports MB/s, wall/op, CPU/op, CPU-excluding-GC/op.-Dorg.mongodb.benchmarks.otel.verify=trueinstalls a counting span processor and reports spans per op (2.00 undersdk-always, 0.02 undersdk-ratio), for wiring checks only.otel-bench.py: one JVM per configuration, configurations interleaved and order rotated per repetition, writesREPORT.md/summary.json; accepts a pre-OTel worktree for the spec's one-time comparison.otel-compare-langs.py,otel-compare-runs.py: cross-language and before/after tables.New benchmark-only deps in the catalog:
opentelemetry-bom1.53.0,opentelemetry-sdk-trace,micrometer-tracing-bridge-otel. Used only bydriver-benchmarks; the driver itself is unchanged.Results (Apple M4 Max, mongod 8.2.6, Temurin 17, 5 interleaved reps, medians)
Loss vs
off/ added CPU µs per op (excl. GC):offvs pre-OTel commitPre-OTel commit is
e1bf5f57b1(parent of #1695). A follow-up draft gates attribute building on the sampling decision and roughly halves the added CPU per op.Usage
Open points
api-onlymapping for a Micrometer driver is a judgement call; raised on the spec PR.