From 9e457cd22eccfc202c69975cb1c018f069643307 Mon Sep 17 00:00:00 2001 From: hz4th_coder Date: Tue, 15 Sep 2026 13:28:37 +0800 Subject: [PATCH] =?UTF-8?q?v2.8.1=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=97=A5=E5=BF=97=E9=87=8D=E5=A4=8D=EF=BC=9A=E5=B9=B6=E5=8F=91?= =?UTF-8?q?=E6=95=B0=E8=A1=A8=E5=A4=B4=E5=8F=AA=E5=9C=A8=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E5=B9=B6=E5=8F=91=E6=A1=A3=E6=97=B6=E6=89=93=E5=8D=B0=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=EF=BC=9B=E6=97=A5=E5=BF=97=E6=9D=A1=E6=95=B0=E8=AE=A1?= =?UTF-8?q?=E6=95=B0=E4=BF=AE=E6=AD=A3=EF=BC=9B=E8=BD=AE=E8=AF=A2=E5=8A=A0?= =?UTF-8?q?=E9=98=B2=E9=87=8D=E5=8F=A0=E9=94=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/js/app.js | 7 ++++++- tester.py | 5 ++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/static/js/app.js b/static/js/app.js index a1dc1d8..a09381b 100644 --- a/static/js/app.js +++ b/static/js/app.js @@ -19,6 +19,7 @@ const STATUS_LABEL = { let currentTestId = null; // 正在跑的测试 id let pollTimer = null; let lastLogId = 0; +let polling = false; // 防止轮询请求重叠:上一请求未返回前不再发,避免同批日志被追加两次 let consoleLogs = []; // 当前测试已加载日志 [{id,level,msg,rel}] // 上下文长度:chips 列表 + 启用集合(默认 512/2048/4096/8192/16384/32768/65536/131072) @@ -326,6 +327,7 @@ function appendLogs(logs) { html += `
[${l.rel.toFixed(3)}s] ${esc(l.msg)}
`; } box.insertAdjacentHTML("beforeend", html); + consoleLogs.push(...logs); // 记录已加载日志,修正“日志条数”一直显示 0 条的问题 $("#log-count").textContent = `${consoleLogs.length} 条`; if (atBottom) box.scrollTop = box.scrollHeight; } @@ -386,7 +388,8 @@ function startTest() { } async function pollLogs() { - if (currentTestId == null) return; + if (currentTestId == null || polling) return; + polling = true; try { const d = await api(`/api/tests/${currentTestId}/logs?after=${lastLogId}`); if (d.logs && d.logs.length) { @@ -399,6 +402,8 @@ async function pollLogs() { } } catch (e) { /* 网络抖动忽略 */ + } finally { + polling = false; } } diff --git a/tester.py b/tester.py index e34eab1..82bb06c 100644 --- a/tester.py +++ b/tester.py @@ -86,6 +86,7 @@ class TestRunner(threading.Thread): self.log("INFO", "校准完成: %.3f tok/字符(%.2f 字符/token)" % (ratio, 1.0 / ratio)) run_seq = 0 + last_conc = None # 只在实际切换并发档时打印一次表头,避免同一并发数重复刷屏 for L in lengths: if self.should_stop(): raise StopRequested() @@ -94,7 +95,9 @@ class TestRunner(threading.Thread): for C in concurrency_levels: if self.should_stop(): raise StopRequested() - self.log("INFO", "══ 并发数 %d(同时 %d 个流)══" % (C, C)) + if C != last_conc: + self.log("INFO", "══ 并发数 %d(同时 %d 个流)══" % (C, C)) + last_conc = C if warmup: self._warmup(base_prompt, C) for i in range(1, n + 1):