-
Notifications
You must be signed in to change notification settings - Fork 9
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: duration & endtime in queries history #1169
Conversation
@@ -170,6 +172,10 @@ function QueryEditor(props: QueryEditorProps) { | |||
schema, | |||
enableTracingLevel, | |||
queryId, | |||
}).then((res) => { | |||
if ('data' in res) { |
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.
better avoid this logic here and make bindings in redux, but I didn't find the may to mix rtk and our reducer without full refactoring
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.
There is a dispatch
in the second param of the queryFn
.
name: 'EndTime', | ||
header: i18n('history.endTime'), | ||
render: ({row}) => | ||
row.endTime ? formatDateTime(new Date(row.endTime as string).getTime()) : '-', |
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.
row.endTime.toString()
instead of row.endTime as string
, it more error proof
src/store/reducers/executeQuery.ts
Outdated
queryStats.duration = DurationUs; | ||
queryStats.endTime = FinishTimeMs; | ||
} else { | ||
const now = Date.now(); | ||
queryStats.duration = (now - timeStart) * 1000; | ||
queryStats.endTime = now; |
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.
What do you think about saving duration as ms
? us
is not very common thing, it's become important not to forget all that conversions (*1000
or parseUsToMs
).
In both cases I suggest adding metric to field name: durationMs
or durationUs
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 keep existing format from api. we could replace us
to ms
in all places, but usually I prefer to keep original data as is (if api returns us - it means there are cases where this precision is important)
Added duration and endime IF Statistics collection mode is set to full in query settings.
Otherwise I have to overwrite this setting, thats seems to be a bad idea
CI Results
Test Status:⚠️ FLAKY
📊 Full Report
Bundle Size: 🔺
Current: 79.00 MB | Main: 79.00 MB
Diff: +0.01 MB (0.01%)
ℹ️ CI Information