mirror of
https://github.com/SECTL/SecScore.git
synced 2026-07-19 21:14:21 +08:00
chore: 为 OAuth 回调链路添加墙钟时间日志
定位 19s 延迟:Rust 命令本体 0ms 完成,延迟在 Tauri IPC 往返。 前后端各步骤加 wall= 时间戳,便于比对 invoke 投递 vs 结果返回耗时。 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -40,9 +40,10 @@ pub async fn oauth_start_callback_server(
|
|||||||
let t0 = std::time::Instant::now();
|
let t0 = std::time::Instant::now();
|
||||||
let log = |step: &str| {
|
let log = |step: &str| {
|
||||||
println!(
|
println!(
|
||||||
"[OAuth Callback] {} +{}ms",
|
"[OAuth Callback] {} +{}ms (wall={})",
|
||||||
step,
|
step,
|
||||||
t0.elapsed().as_millis()
|
t0.elapsed().as_millis(),
|
||||||
|
chrono::Local::now().format("%H:%M:%S%.3f")
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
log("oauth_start_callback_server enter");
|
log("oauth_start_callback_server enter");
|
||||||
|
|||||||
@@ -129,7 +129,9 @@ export function OAuthLogin({ visible, onClose, onSuccess }: OAuthLoginProps) {
|
|||||||
setLoading(true)
|
setLoading(true)
|
||||||
const t0 = performance.now()
|
const t0 = performance.now()
|
||||||
const log = (step: string) =>
|
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")
|
log("handleOAuthLogin start")
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in New Issue
Block a user