Skip to content

chore(ci): add telemetry-enabled perf task with local HTTPS server MONGOSH-3454#2784

Merged
nbbeeken merged 2 commits into
mainfrom
MONGOSH-3454-telemetry-perf
Jul 24, 2026
Merged

chore(ci): add telemetry-enabled perf task with local HTTPS server MONGOSH-3454#2784
nbbeeken merged 2 commits into
mainfrom
MONGOSH-3454-telemetry-perf

Conversation

@nbbeeken

@nbbeeken nbbeeken commented Jul 22, 2026

Copy link
Copy Markdown
Collaborator

No description provided.

@nbbeeken
nbbeeken requested a review from a team as a code owner July 22, 2026 22:08
@nbbeeken
nbbeeken requested review from Copilot and esvm July 22, 2026 22:08

Copilot AI left a comment

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.

Pull request overview

Adds a telemetry-enabled performance CI task so Evergreen can produce side-by-side perf series (baseline vs telemetry-on) by routing telemetry to a locally launched HTTPS sink and validating that expected telemetry events were emitted.

Changes:

  • Adds a new Evergreen task perf_tests_linux_x64_telemetry and gates telemetry setup/verification in run_perf_tests via mongosh_perf_telemetry.
  • Introduces a minimal local HTTPS telemetry sink (.evergreen/telemetry-sink.js) that records received events to NDJSON for post-run assertions/logging.
  • Updates the perf smoke-test harness to reset cross-process telemetry throttling state between iterations.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
packages/cli-repl/src/smoke-tests.ts Resets on-disk telemetry throttling state between perf iterations.
docs/superpowers/specs/2026-07-22-telemetry-perf-ci-task-design.md Design doc describing the telemetry-enabled perf task approach and verification.
.evergreen/telemetry-sink.js Adds a local HTTPS NDJSON-recording sink used by the telemetry perf task.
.evergreen/evergreen.yml.in Adds telemetry-gated sink orchestration + verification and introduces the new perf task.
.evergreen.yml Regenerated Evergreen config reflecting the new task and gated telemetry block.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/cli-repl/src/smoke-tests.ts Outdated
Comment thread packages/cli-repl/src/smoke-tests.ts
Comment thread .evergreen/telemetry-sink.js Outdated
Comment thread .evergreen/evergreen.yml.in Outdated
@nbbeeken
nbbeeken marked this pull request as draft July 22, 2026 22:19
@nbbeeken
nbbeeken removed the request for review from esvm July 22, 2026 22:19
@nbbeeken
nbbeeken force-pushed the MONGOSH-3454-telemetry-perf branch 2 times, most recently from e9bd1f5 to fda2b62 Compare July 23, 2026 02:43
@nbbeeken

Copy link
Copy Markdown
Collaborator Author
test baseline (s) telemetry (s) Δ
eval_nodb_print_plainvm 0.307 0.372 +21%
db_eval_plainvm 0.370 0.444 +20%
db_eval_repl 0.436 0.511 +17%
eval_nodb_print_repl 0.393 0.445 +13.5%
db_cursor_iteration_repl 1.164 1.282 +10%
async_rewrite_foreach 1.481 1.556 +5%
db_cursor_iteration_plainvm 1.298 1.346 +3.6%
db_repeat_command 2.177 2.196 +0.9%
mongosh_version 0.158 0.159 ~0%
executable_size 198341600 198341600 identical

@nbbeeken
nbbeeken force-pushed the MONGOSH-3454-telemetry-perf branch from fda2b62 to 70130af Compare July 23, 2026 03:46
@nbbeeken
nbbeeken marked this pull request as ready for review July 23, 2026 03:46
@nbbeeken
nbbeeken requested a review from alenakhineika July 23, 2026 03:46
@nbbeeken
nbbeeken force-pushed the MONGOSH-3454-telemetry-perf branch from 70130af to 36e1e94 Compare July 23, 2026 03:49
script: |
mkdir -p npm-logs
tar cvzf npm-logs.tgz npm-logs
tar czf npm-logs.tgz npm-logs

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removing the verbose flag here makes most conclusions visible without clicking through to one of the log viewers

Comment thread .evergreen/perf-get.sh
@@ -0,0 +1,36 @@
#! /usr/bin/env bash

# Fetch raw performance results for a given Evergreen version/patch from the

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes comparisons easy

@nbbeeken nbbeeken changed the title chore(ci): add telemetry-enabled perf task with local HTTPS sink MONGOSH-3454 chore(ci): add telemetry-enabled perf task with local HTTPS server MONGOSH-3454 Jul 23, 2026
Comment thread .evergreen/evergreen.yml.in Outdated
- command: shell.exec
# Passed explicitly instead of add_expansions_to_env: the spawned
# mongosh processes inherit this environment, so we avoid handing
# every expansion (including secrets) to 160 child processes.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From where do we get this number? How do we know it is exactly 160 child processes?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Each scenario runs 20 times, so it actually should be 180 I didn't count mongodb_version, but also not necessary to mention this count, removed!

Comment thread .evergreen/telemetry-sink.mts Outdated

process.on('SIGTERM', () => {
server.closeAllConnections?.();
server.close(() => process.exit(0));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we wait here for the write stream to actually finish flushing to disk?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yea! done

Comment thread .evergreen/perf-test.sh Outdated
connection_count=$(grep -c '"event":"new-connection"' telemetry-sink-events.ldjson || true)
echo "identify=$identify_count new-connection=$connection_count"
[ "$identify_count" -ge 100 ]
[ "$connection_count" -ge 80 ]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also these numbers, how do we decide on those?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am just trying to see if anything arrived on the server, in case of misconfiguration I didn't want the perf tests to happily be green but nothing reached the server. I've lowered the barrier to pass by a ton, just 10 events need to show up. We have unit/int tests elsewhere to check this keeps working.

fi
add_expansions_to_env: true
binary: bash
args: ["src/.evergreen/perf-send.sh"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where do we use perf-get.sh?

@nbbeeken nbbeeken Jul 23, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No where! That is for humans/agents to use locally, as long as you're on the corp vpn you can pull down perf resutls, makes it easier to browse and compare than using the perf baron ui

@nbbeeken
nbbeeken requested a review from alenakhineika July 23, 2026 19:20
@nbbeeken
nbbeeken merged commit 01d5272 into main Jul 24, 2026
151 of 154 checks passed
@nbbeeken
nbbeeken deleted the MONGOSH-3454-telemetry-perf branch July 24, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants