Skip to content

perf(logging): cap telemetry requests at 1 sec MONGOSH-3454 - #2803

Merged
nbbeeken merged 8 commits into
mainfrom
MONGOSH-3454-script-perf
Jul 29, 2026
Merged

perf(logging): cap telemetry requests at 1 sec MONGOSH-3454#2803
nbbeeken merged 8 commits into
mainfrom
MONGOSH-3454-script-perf

Conversation

@nbbeeken

@nbbeeken nbbeeken commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Adds a performance test that runs a db.hello() from a script file

MONGOSH-3454

@nbbeeken nbbeeken changed the title chore(perf): add scripting performance test perf(logging): cap telemetry requests at 1 sec Jul 28, 2026
@nbbeeken
nbbeeken marked this pull request as ready for review July 28, 2026 19:27
@nbbeeken
nbbeeken requested a review from a team as a code owner July 28, 2026 19:27
@nbbeeken
nbbeeken requested review from Sgrinfy and Copilot July 28, 2026 19:27
@codeowners-service-app
codeowners-service-app Bot requested a review from esvm July 28, 2026 19:27
@codeowners-service-app

Copy link
Copy Markdown

Assigned esvm for team mongosh-developers because Sgrinfy is out of office.

@nbbeeken nbbeeken changed the title perf(logging): cap telemetry requests at 1 sec perf(logging): cap telemetry requests at 1 sec MONGOSH-3454 Jul 28, 2026

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

This PR reduces telemetry send/flush timeouts to cap logging-related network overhead, and adds a new startup/performance smoke test that exercises db.hello() when run from a script file.

Changes:

  • Reduce telemetry request timeout from 5s to 1s and flush timeout from 2s to 1s.
  • Add a performance smoke test that runs db.hello() via --file=$INPUT_AS_FILE in plain-vm JS context.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
packages/logging/src/telemetry-client.ts Lowers telemetry request + flush timeouts to 1s.
packages/cli-repl/src/smoke-tests.ts Adds a new perf smoke test covering db.hello() executed from a script file.
Comments suppressed due to low confidence (1)

packages/logging/src/telemetry-client.ts:11

  • The PR description mentions adding a performance test, but it doesn’t mention the behavior change of reducing telemetry request/flush timeouts to 1s. Please update the PR description (or add a brief note in code/release notes) so reviewers and downstream consumers understand the motivation and expected impact (e.g., increased telemetry drop rate vs. improved shutdown latency).
export const REQUEST_TIMEOUT_MS = 1_000;

const FLUSH_TIMEOUT_MS = 1_000;

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

Comment thread packages/logging/src/telemetry-client.ts Outdated
@nbbeeken
nbbeeken requested review from alenakhineika and removed request for Sgrinfy and esvm July 28, 2026 20:08
@nbbeeken
nbbeeken requested a review from alenakhineika July 29, 2026 15:23
Comment thread packages/logging/src/telemetry-client.ts Outdated
Comment thread packages/logging/src/telemetry-client.ts Outdated
nbbeeken added 3 commits July 29, 2026 13:30
… and bound the list by removing the prior promises added to it
@nbbeeken
nbbeeken requested a review from alenakhineika July 29, 2026 17:42
private readonly flushTimeoutMs: number;
private readonly controller = new AbortController();
private pending = 0;
private pending = new Set<Promise<unknown> | undefined>();

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.

Is the | undefined really necessary here?

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.

oops, from a previous iteration where the promise could be falsey

@nbbeeken
nbbeeken merged commit a188665 into main Jul 29, 2026
12 of 13 checks passed
@nbbeeken
nbbeeken deleted the MONGOSH-3454-script-perf branch July 29, 2026 19:53
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.

4 participants