-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
Query execution time #38999
Query execution time #38999
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.
Minor comments
@@ -0,0 +1,9 @@ | |||
import { t } from "ttag"; | |||
|
|||
export const formatDuration = (time: number): string => { |
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.
nit: we have other time utils in frontend/src/metabase/lib/formatting/time.ts
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.
I know but none of them could be reused here and there already is a duration
function - I didn't want to put another function like that in there, because it'd be hard to distinguish them.
So I decided it's best to keep it local to the component it's used in.
import { t } from "ttag"; | ||
|
||
import { Tooltip } from "metabase/ui"; | ||
|
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.
nit: I believe there shouldn't be an empty line between those groups as both they both point out to the relative files
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.
If it starts with a dot it's relative, if it's absolute it's internal, so all is good here
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.
that's not true, you know, it's a relative path with webpack paths mapping
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.
I'm not sure about terminology here but this is what import/order
enforces with the current config
expect(formatDuration(1425)).toBe("1.4 s"); | ||
expect(formatDuration(1475)).toBe("1.5 s"); | ||
expect(formatDuration(1500)).toBe("1.5 s"); | ||
expect(formatDuration(120000)).toBe("120.0 s"); |
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.
.0
looks weird
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.
On the other hand 2.1 s
and 2 s
look inconsistent and would cause small layout shift when re-running the query
@kamilmielnik Did you forget to add a milestone to the issue for this PR? When and where should I add a milestone? |
Closes #9408
Design doc: https://www.notion.so/metabase/Show-query-response-time-in-native-queries-ca4c47e01349463198446589848c2714
Slack discussion: https://metaboat.slack.com/archives/C0645JP1W81/p1708516928531709
Description
Shows query execution time for native queries in the footer of the query builder.
123 ms
)3.9 s
)Demo
2024-02-21.18-48-16.mp4