Skip to content
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

Merged
merged 6 commits into from
Aug 21, 2024
Merged

feat: duration & endtime in queries history #1169

merged 6 commits into from
Aug 21, 2024

Conversation

sareyu
Copy link
Collaborator

@sareyu sareyu commented Aug 15, 2024

image

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

Total Passed Failed Flaky Skipped
114 111 0 3 0

Bundle Size: 🔺

Current: 79.00 MB | Main: 79.00 MB
Diff: +0.01 MB (0.01%)

⚠️ Bundle size increased. Please review.

ℹ️ CI Information
  • Test recordings for failed tests are available in the full report.
  • Bundle size is measured for the entire 'dist' directory.
  • 📊 indicates links to detailed reports.
  • 🔺 indicates increase, 🔽 decrease, and ✅ no change in bundle size.

@sareyu sareyu linked an issue Aug 15, 2024 that may be closed by this pull request
@@ -170,6 +172,10 @@ function QueryEditor(props: QueryEditorProps) {
schema,
enableTracingLevel,
queryId,
}).then((res) => {
if ('data' in res) {
Copy link
Collaborator Author

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

Copy link
Collaborator

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.

@sareyu sareyu marked this pull request as ready for review August 15, 2024 15:37
artemmufazalov
artemmufazalov previously approved these changes Aug 16, 2024
name: 'EndTime',
header: i18n('history.endTime'),
render: ({row}) =>
row.endTime ? formatDateTime(new Date(row.endTime as string).getTime()) : '-',
Copy link
Member

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

Comment on lines 247 to 252
queryStats.duration = DurationUs;
queryStats.endTime = FinishTimeMs;
} else {
const now = Date.now();
queryStats.duration = (now - timeStart) * 1000;
queryStats.endTime = now;
Copy link
Member

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

Copy link
Collaborator Author

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)

@sareyu sareyu merged commit f28402c into main Aug 21, 2024
6 checks passed
@sareyu sareyu deleted the issue620 branch August 21, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add execution date and duration to Query History table
3 participants