chore: 为 OAuth 回调链路添加墙钟时间日志

定位 19s 延迟:Rust 命令本体 0ms 完成,延迟在 Tauri IPC 往返。
前后端各步骤加 wall= 时间戳,便于比对 invoke 投递 vs 结果返回耗时。

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
JSR
2026-07-05 20:22:14 +08:00
parent 276e33a563
commit c0898b5f6f
2 changed files with 6 additions and 3 deletions
+3 -2
View File
@@ -40,9 +40,10 @@ pub async fn oauth_start_callback_server(
let t0 = std::time::Instant::now();
let log = |step: &str| {
println!(
"[OAuth Callback] {} +{}ms",
"[OAuth Callback] {} +{}ms (wall={})",
step,
t0.elapsed().as_millis()
t0.elapsed().as_millis(),
chrono::Local::now().format("%H:%M:%S%.3f")
);
};
log("oauth_start_callback_server enter");
+3 -1
View File
@@ -129,7 +129,9 @@ export function OAuthLogin({ visible, onClose, onSuccess }: OAuthLoginProps) {
setLoading(true)
const t0 = performance.now()
const log = (step: string) =>
console.log(`[OAuthLogin] ${step} +${Math.round(performance.now() - t0)}ms`)
console.log(
`[OAuthLogin] ${step} +${Math.round(performance.now() - t0)}ms (wall=${new Date().toISOString()})`
)
log("handleOAuthLogin start")
try {