feat: improve endpoint speed test UI and accuracy
- Add color-coded latency indicators (green <300ms, yellow <500ms, orange <800ms, red >=800ms) - Fix speed test button width to prevent layout shift during testing - Clear latency data before each test to properly show loading state - Add warmup request in speed test to avoid first packet penalty and improve accuracy
This commit is contained in:
@@ -65,6 +65,10 @@ pub async fn test_endpoints(
|
||||
}
|
||||
};
|
||||
|
||||
// 先进行一次“热身”请求,忽略其结果,仅用于复用连接/绕过首包惩罚
|
||||
let _ = client.get(parsed_url.clone()).send().await;
|
||||
|
||||
// 第二次请求开始计时,并将其作为结果返回
|
||||
let start = Instant::now();
|
||||
match client.get(parsed_url).send().await {
|
||||
Ok(resp) => {
|
||||
|
||||
Reference in New Issue
Block a user