Skip to content

refactor(observability): unify timing instrumentation across runtimes#493

Merged
limityan merged 1 commit intoGCWing:mainfrom
limityan:codex/i18n-locale-registry
Apr 23, 2026
Merged

refactor(observability): unify timing instrumentation across runtimes#493
limityan merged 1 commit intoGCWing:mainfrom
limityan:codex/i18n-locale-registry

Conversation

@limityan
Copy link
Copy Markdown
Collaborator

Summary

  • Add shared timing helpers for Web UI and Rust core.
  • Merge debugProbe back into the shared logger/timing path and normalize frontend diagnostic fields to durationMs.
  • Replace representative ad-hoc timing code in frontend and backend modules with shared helpers.
  • Add a few low-noise timing logs for slow filesystem operations, context compression, and snapshot completion.
  • Update frontend and backend logging guidance for future instrumentation work.

Why

  • Timing diagnostics had started to drift across multiple patterns, which made filtering, grep, and later cleanup harder.
  • We wanted better visibility into a few important execution paths without adding high-frequency logging noise or changing protocol-level duration fields.

Scope

  • Frontend:
    • add src/web-ui/src/shared/utils/timing.ts
    • converge debugProbe and representative startup/i18n/LSP/API/git/editor/terminal timing sites onto shared helpers
  • Backend:
    • add src/crates/core/src/util/timing.rs
    • reuse shared elapsed helpers in representative desktop/core/ai-adapters call sites
    • enrich existing completion logs with duration metadata where it improves diagnosis without increasing log volume
  • Documentation:
    • update src/web-ui/LOGGING.md
    • update src/crates/LOGGING.md

Non-Goals

  • No protocol or persisted field renames such as duration_ms, execution_time_ms, or response_time_ms.
  • No broad migration of animation, scroll, polling, or deadline control-flow timing.
  • No attempt to add exhaustive timing logs everywhere.

Verification

  • pnpm --dir src/web-ui exec eslint src/main.tsx src/infrastructure/i18n/core/I18nService.ts src/shared/utils/timing.ts src/shared/utils/debugProbe.ts src/shared/utils/index.ts src/tools/lsp/services/LspService.ts src/tools/lsp/services/LspExtensionRegistry.ts src/tools/lsp/services/LspDiagnostics.ts src/flow_chat/services/EventBatcher.ts src/app/hooks/useWindowControls.ts src/tools/terminal/components/Terminal.tsx src/tools/git/state/GitStateManager.ts src/tools/git/services/GitService.ts src/tools/editor/components/CodeEditor.tsx src/tools/editor/components/MarkdownEditor.tsx src/infrastructure/api/service-api/ApiClient.ts
  • pnpm --dir src/web-ui exec tsc --noEmit
  • cargo check -p bitfun-core -p bitfun-desktop -p bitfun-ai-adapters

@limityan limityan merged commit f2bb148 into GCWing:main Apr 23, 2026
4 checks passed
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.

1 participant