-
Notifications
You must be signed in to change notification settings - Fork 83
feat: implement :perftrace and :help commands #632
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
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 implements the :perftrace command to redirect performance statistics output to a file, stderr, or stdout, working in conjunction with the -p flag from PR #631.
Changes:
- Added stat writer infrastructure with GetStat/SetStat methods following the established pattern for output/error writers
- Implemented PERFTRACE command supporting file paths, "stdout", and "stderr" with variable substitution
- Added comprehensive test coverage for the command functionality
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/sqlcmd/sqlcmd.go | Added stat field and GetStat()/SetStat() methods for managing performance statistics output writer |
| pkg/sqlcmd/commands.go | Registered PERFTRACE command and implemented perftraceCommand() function with file/stdout/stderr support |
| pkg/sqlcmd/commands_test.go | Added TestPerftraceCommand() with comprehensive test scenarios and added PERFTRACE parsing tests |
| README.md | Documented the :perftrace command with usage example |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 6 comments.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.
e7abfe7 to
4d25bf2
Compare
652c011 to
1175a7e
Compare
:perftrace redirects timing/statistics output to a file, stderr, or stdout. :help displays the list of available sqlcmd commands with usage. Both commands validate arguments and return appropriate errors.
1175a7e to
ccd2a31
Compare
Summary
Adds the
:perftracecommand to redirect performance statistics output to a file, stderr, or stdout. This works in conjunction with the-pflag (PR #631) to control where timing statistics are written.Syntax
Changes
statwriter field andGetStat/SetStatmethodsPERFTRACEcommand with file/stdout/stderr supportTesting
golangci-lint runpasses (pre-existing warnings only)Related
-pflag for print statistics