Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add a new “Startup Time” event for sessions MONGOSH-1653 #1761

Merged
merged 11 commits into from
Nov 30, 2023

Conversation

kmruiz
Copy link
Contributor

@kmruiz kmruiz commented Nov 29, 2023

No description provided.

@kmruiz kmruiz marked this pull request as ready for review November 29, 2023 16:22
packages/logging/src/setup-logger-and-telemetry.ts Outdated Show resolved Hide resolved
packages/shell-evaluator/package.json Outdated Show resolved Hide resolved
packages/cli-repl/src/startup-timing.ts Outdated Show resolved Hide resolved
packages/cli-repl/src/cli-repl.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@baileympearson baileympearson left a comment

Choose a reason for hiding this comment

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

some comments, but one change requested in the package lock

package-lock.json Outdated Show resolved Hide resolved
packages/cli-repl/src/startup-timing.ts Outdated Show resolved Hide resolved
packages/logging/src/setup-logger-and-telemetry.ts Outdated Show resolved Hide resolved
Copy link
Member

@Anemy Anemy left a comment

Choose a reason for hiding this comment

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

lgtm! one non-blocker nit

Comment on lines +601 to +617
export const TimingCategories = {
REPLInstantiation: 'REPLInstantiation',
UserConfigLoading: 'UserConfigLoading',
DriverSetup: 'DriverSetup',
Logging: 'Logging',
SnippetLoading: 'SnippetLoading',
Snapshot: 'Snapshot',
ResourceFileLoading: 'ResourceFileLoading',
AsyncRewrite: 'AsyncRewrite',
Eval: 'Eval',
EvalFile: 'EvalFile',
Telemetry: 'Telemetry',
Main: 'Main',
} as const;

export type TimingCategory =
(typeof TimingCategories)[keyof typeof TimingCategories];
Copy link
Member

@Anemy Anemy Nov 30, 2023

Choose a reason for hiding this comment

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

Small nit, I think fine as is, we have other places in the code base with this pattern already. IIRC we try to avoid enums and rather use string literals in our code, so this would look like:

Suggested change
export const TimingCategories = {
REPLInstantiation: 'REPLInstantiation',
UserConfigLoading: 'UserConfigLoading',
DriverSetup: 'DriverSetup',
Logging: 'Logging',
SnippetLoading: 'SnippetLoading',
Snapshot: 'Snapshot',
ResourceFileLoading: 'ResourceFileLoading',
AsyncRewrite: 'AsyncRewrite',
Eval: 'Eval',
EvalFile: 'EvalFile',
Telemetry: 'Telemetry',
Main: 'Main',
} as const;
export type TimingCategory =
(typeof TimingCategories)[keyof typeof TimingCategories];
export type TimingCategory =
| 'REPLInstantiation'
| 'UserConfigLoading'
| 'DriverSetup'
| 'Logging'
| 'SnippetLoading'
| 'Snapshot'
| 'ResourceFileLoading'
| 'AsyncRewrite'
| 'Eval'
| 'EvalFile'
| 'Telemetry'
| 'Main';

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, this would have been a small nice-to-have :)

@kmruiz kmruiz merged commit 2cd6fb5 into main Nov 30, 2023
57 of 60 checks passed
@kmruiz kmruiz deleted the feature/MONGOSH-1653 branch November 30, 2023 19:45
Comment on lines +44 to +45
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [category, _, time] of timingData) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, just fyi:

Suggested change
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (const [category, _, time] of timingData) {
for (const [category,, time] of timingData) {

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