-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat(datastore): Add query profiling #9200
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.
LGTM. I think @kolea2 mentioned that samples will be required as well so samples could be added in this PR or in a separate PR.
Samples at GoogleCloudPlatform/golang-samples#3742 |
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 can do another review once the owl-bot PR comes in so that all the CI checks pass.
Do not merge until release freeze ends in mid April |
type ExplainOptions struct { | ||
// When false (the default), the query will be planned, returning only | ||
// metrics from the planning stages. | ||
// When true, the query will be planned and executed, returning the full | ||
// query results along with both planning and execution stage metrics. | ||
Analyze bool | ||
} |
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.
Why is this not structured as a private struct explainOptions
with a function ExplainOptions
that returns an instance of explainOptions
? With this structure the user would have to pass in stuff like ExplainOptions{Analyze: true}
instead of ExplainOptions(true)
, right?
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.
Right now, ExplainOptions contains only Analyze field. In the future, if more fields are added to ExplainOptions struct, user will no longer be able to use ExplainOptions(true).
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.
Ahh I see, I was confused because this is a proto field, not an option in the Golang sense of the word.
Introducing ExplainOptions:
samples at GoogleCloudPlatform/golang-samples#3742