-
Notifications
You must be signed in to change notification settings - Fork 7
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
Add performance hints support #309
Conversation
This allows the driver to be configured to query with performance hints enabled. When enabled, performance hints will be returned in the summary of the response.
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.
Approved assuming you make the recommended changes.
src/client-configuration.ts
Outdated
/** | ||
* Enable or disable performance hints. If no value is provided, performance hints will be disabled. | ||
*/ | ||
performanceHints?: boolean; |
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.
As much as this pains me, for better or worse, these types have been using snake_case
for configuration that gets passed as headers. We should keep these consistent and make this performance_hints
.
We can move everything user-facing to camel in a future major version change. Until then, it's better to be consistent even if it's sort of silly.
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.
o thats cool! I just didn't realize that and I just trend towards the camel case by default
src/client-configuration.ts
Outdated
@@ -120,6 +120,11 @@ export interface ClientConfiguration { | |||
*/ | |||
typecheck?: boolean; | |||
|
|||
/** | |||
* Enable or disable performance hints. If no value is provided, performance hints will be disabled. |
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.
Can we add the context that this shows up in QueryInfo's summary? Otherwise, it's not very clear how this changes the output.
9ca00cb
to
fdcbe92
Compare
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.
LGTM. I left some suggestions that you can take or leave as wanted. I'll ensure JS driver support is covered in https://github.com/fauna/docs.fauna.com/pull/2676.
Co-authored-by: James Rodewig <james.rodewig@fauna.com>
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.
LGTM. Y'all did all the hard work!
ENG-6989
Description
This allows the driver to be configured to query with performance hints enabled. When enabled, performance hints will be returned in the summary of the response.
Motivation and context
Without this change we won't be able to display performance hints in the dashboard or CLI. Performance hints are intended to be a self service way for users to debug query performance/cost and just overall find ways to improve their queries.
How was the change tested?
I added a test for the specified header. I also tested this version of the CLI with a locally running version of the dashboard to ensure I could get performance hints to show up.
Screenshots (if appropriate):
Change types
Checklist:
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.