Skip to content

feat(editor): show server time and fetch time separately in result status bar (#990) - #1021

Open
Totopo27 wants to merge 2 commits into
TabularisDB:mainfrom
Totopo27:feat/separate-server-and-fetch-time
Open

Totopo27 wants to merge 2 commits into
TabularisDB:mainfrom
Totopo27:feat/separate-server-and-fetch-time

Conversation

@Totopo27

Copy link
Copy Markdown
Contributor

Closes #990

Summary

Splits the query duration under query results into server/execution time (until the first row is received) and fetch time (transferring and reading the remaining rows), surfaced on hover via a breakdown tooltip.

  • Rust core / built-in drivers:
    • Added optional \server_time_ms\ and \ etch_time_ms\ fields to \QueryResult\ (\src-tauri/src/models.rs).
    • Recorded time-to-first-row and fetch completion in PostgreSQL (\exec_on_pg_client), MySQL (\exec_on_mysql_conn), and SQLite (\exec_on_sqlite_conn). Non-result-set statements leave both as \None.
    • Added serde round-trip unit test for \QueryResult\ with timing fields.
  • Frontend / Types:
    • Extended \QueryResult\ in \src/types/editor.ts\ with optional \server_time_ms?: number\ and \ etch_time_ms?: number.
    • Added \ ormatTimingTooltip\ in \src/utils/formatTime.ts\ with unit tests.
    • Added localized strings in all 11 locale files under \editor.timing\ (\execution, \ etch, \ otal).
    • Surfaced the timing breakdown via \ itle\ tooltip in \ResultEntryContent.tsx, \StackedResultItem.tsx, and \Editor.tsx\ when available. When not provided (e.g. plugins or statements without rows), only the total duration is shown as before.

Verification

  • \pnpm typecheck: clean.
  • \pnpm lint: clean.
  • \pnpm test tests/utils/formatTime.test.ts tests/components/ui/ResultEntryContent.test.tsx: passed.
  • \cargo fmt --check: untouched rust files stay intact.

const timingTooltip = entry.result
? formatTimingTooltip(
{
serverTimeMs: entry.result.server_time_ms,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: totalTimeMs uses client-side entry.executionTime which may not equal server_time_ms + fetch_time_ms

The tooltip passes entry.executionTime (client-measured total) as totalTimeMs, but server_time_ms and fetch_time_ms are server-measured. Network latency and client processing can cause these to not add up (e.g., server=30ms + fetch=15ms ≠ client=50ms). Consider computing total as (serverTimeMs ?? 0) + (fetchTimeMs ?? 0) when both server and fetch are present, or omit the total line when breakdown is shown.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

const timingTooltip = entry.result
? formatTimingTooltip(
{
serverTimeMs: entry.result.server_time_ms,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: totalTimeMs uses client-side entry.executionTime which may not equal server_time_ms + fetch_time_ms

Same issue as in ResultEntryContent: the tooltip passes entry.executionTime (client-measured) as totalTimeMs, but server_time_ms/fetch_time_ms are server-measured. The parts may not add up to the total shown. Consider computing total from server+fetch when both are available.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

Comment thread src/pages/Editor.tsx
activeTab.result
? formatTimingTooltip(
{
serverTimeMs: activeTab.result.server_time_ms,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WARNING: totalTimeMs uses client-side activeTab.executionTime which may not equal server_time_ms + fetch_time_ms

Same issue: activeTab.executionTime is client-measured total time, while server_time_ms/fetch_time_ms are server-measured. The tooltip may show confusing numbers where Execution + Fetch ≠ Total. Consider using (serverTimeMs ?? 0) + (fetchTimeMs ?? 0) for the total when breakdown is available.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

truncated: set.truncated,
pagination: None,
additional_results: None,
server_time_ms: None,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SUGGESTION: Additional result sets from multi-result statements lack timing info

The additional_results (from stored procedures with multiple SELECTs) have server_time_ms: None and fetch_time_ms: None. Consider propagating timing per result set if feasible, or document this limitation. The primary result set correctly includes timing.


Reply with @kilocode-bot fix it to have Kilo Code address this issue.

@kilo-code-bot

kilo-code-bot Bot commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Code Review Summary

Status: 1 Issue Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 0
SUGGESTION 1
Issue Details (click to expand)

SUGGESTION

File Line Issue
src-tauri/src/drivers/mysql/mod.rs 1543 Additional result sets from multi-result statements lack timing info
Files Reviewed (5 files)
  • src-tauri/tests/postgres_integration/golden.rs
  • src/utils/formatTime.ts
  • tests/components/ui/ResultEntryContent.test.tsx
  • tests/setup.ts
  • tests/utils/formatTime.test.ts

Fix these issues in Kilo Cloud

Previous Review Summary (commit 532373f)

Current summary above is authoritative. Previous snapshots are kept for context only.

Previous review (commit 532373f)

Status: 4 Issues Found | Recommendation: Address before merge

Overview

Severity Count
CRITICAL 0
WARNING 3
SUGGESTION 1
Issue Details (click to expand)

WARNING

File Line Issue
src/components/ui/ResultEntryContent.tsx 86 totalTimeMs uses client-side entry.executionTime which may not equal server_time_ms + fetch_time_ms
src/components/ui/StackedResultItem.tsx 119 totalTimeMs uses client-side entry.executionTime which may not equal server_time_ms + fetch_time_ms
src/pages/Editor.tsx 5276 totalTimeMs uses client-side activeTab.executionTime which may not equal server_time_ms + fetch_time_ms

SUGGESTION

File Line Issue
src-tauri/src/drivers/mysql/mod.rs 1543 Additional result sets from multi-result statements lack timing info
Files Reviewed (23 files)
  • src-tauri/src/drivers/mysql/mod.rs
  • src-tauri/src/drivers/postgres/mod.rs
  • src-tauri/src/drivers/sqlite/mod.rs
  • src-tauri/src/models.rs
  • src/components/ui/ResultEntryContent.tsx
  • src/components/ui/StackedResultItem.tsx
  • src/i18n/locales/de.json
  • src/i18n/locales/en.json
  • src/i18n/locales/es.json
  • src/i18n/locales/fr.json
  • src/i18n/locales/it.json
  • src/i18n/locales/ja.json
  • src/i18n/locales/ko.json
  • src/i18n/locales/pt-BR.json
  • src/i18n/locales/ru.json
  • src/i18n/locales/tl.json
  • src/i18n/locales/zh.json
  • src/pages/Editor.tsx
  • src/types/editor.ts
  • src/utils/formatTime.ts
  • tests/components/ui/ResultEntryContent.test.tsx
  • tests/setup.ts
  • tests/utils/formatTime.test.ts

Fix these issues in Kilo Cloud


Reviewed by free · Input: 161.8K · Output: 3.7K · Cached: 82.1K

….ts, and ignore volatile timing in golden captures
@github-actions

Copy link
Copy Markdown
Contributor

Preview build

The preview build of commit bbd27f8 failed (skipped). See the workflow run for logs.

This branch has not been deployed

No deployments
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.

[Feat]: Show server time and fetch time separately in the result status bar

1 participant