Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9580372f85 | ||
|
|
9e457cd22e |
+8
-3
@@ -19,10 +19,11 @@ const STATUS_LABEL = {
|
|||||||
let currentTestId = null; // 正在跑的测试 id
|
let currentTestId = null; // 正在跑的测试 id
|
||||||
let pollTimer = null;
|
let pollTimer = null;
|
||||||
let lastLogId = 0;
|
let lastLogId = 0;
|
||||||
|
let polling = false; // 防止轮询请求重叠:上一请求未返回前不再发,避免同批日志被追加两次
|
||||||
let consoleLogs = []; // 当前测试已加载日志 [{id,level,msg,rel}]
|
let consoleLogs = []; // 当前测试已加载日志 [{id,level,msg,rel}]
|
||||||
|
|
||||||
// 上下文长度:chips 列表 + 启用集合(默认 512/2048/4096/8192/16384/32768/65536/131072)
|
// 上下文长度:chips 列表 + 启用集合(默认 4096/8192/16384/32768/65536/98304/131072)
|
||||||
const DEFAULT_CONTEXT_LENGTHS = [512, 2048, 4096, 8192, 16384, 32768, 65536, 131072];
|
const DEFAULT_CONTEXT_LENGTHS = [4096, 8192, 16384, 32768, 65536, 98304, 131072];
|
||||||
let contextLengths = [...DEFAULT_CONTEXT_LENGTHS];
|
let contextLengths = [...DEFAULT_CONTEXT_LENGTHS];
|
||||||
let contextLengthsActive = new Set(contextLengths);
|
let contextLengthsActive = new Set(contextLengths);
|
||||||
|
|
||||||
@@ -326,6 +327,7 @@ function appendLogs(logs) {
|
|||||||
html += `<div class="ln ${esc(l.level)}"><span class="ts">[${l.rel.toFixed(3)}s]</span> ${esc(l.msg)}</div>`;
|
html += `<div class="ln ${esc(l.level)}"><span class="ts">[${l.rel.toFixed(3)}s]</span> ${esc(l.msg)}</div>`;
|
||||||
}
|
}
|
||||||
box.insertAdjacentHTML("beforeend", html);
|
box.insertAdjacentHTML("beforeend", html);
|
||||||
|
consoleLogs.push(...logs); // 记录已加载日志,修正“日志条数”一直显示 0 条的问题
|
||||||
$("#log-count").textContent = `${consoleLogs.length} 条`;
|
$("#log-count").textContent = `${consoleLogs.length} 条`;
|
||||||
if (atBottom) box.scrollTop = box.scrollHeight;
|
if (atBottom) box.scrollTop = box.scrollHeight;
|
||||||
}
|
}
|
||||||
@@ -386,7 +388,8 @@ function startTest() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async function pollLogs() {
|
async function pollLogs() {
|
||||||
if (currentTestId == null) return;
|
if (currentTestId == null || polling) return;
|
||||||
|
polling = true;
|
||||||
try {
|
try {
|
||||||
const d = await api(`/api/tests/${currentTestId}/logs?after=${lastLogId}`);
|
const d = await api(`/api/tests/${currentTestId}/logs?after=${lastLogId}`);
|
||||||
if (d.logs && d.logs.length) {
|
if (d.logs && d.logs.length) {
|
||||||
@@ -399,6 +402,8 @@ async function pollLogs() {
|
|||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
/* 网络抖动忽略 */
|
/* 网络抖动忽略 */
|
||||||
|
} finally {
|
||||||
|
polling = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ class TestRunner(threading.Thread):
|
|||||||
self.log("INFO", "校准完成: %.3f tok/字符(%.2f 字符/token)" % (ratio, 1.0 / ratio))
|
self.log("INFO", "校准完成: %.3f tok/字符(%.2f 字符/token)" % (ratio, 1.0 / ratio))
|
||||||
|
|
||||||
run_seq = 0
|
run_seq = 0
|
||||||
|
last_conc = None # 只在实际切换并发档时打印一次表头,避免同一并发数重复刷屏
|
||||||
for L in lengths:
|
for L in lengths:
|
||||||
if self.should_stop():
|
if self.should_stop():
|
||||||
raise StopRequested()
|
raise StopRequested()
|
||||||
@@ -94,7 +95,9 @@ class TestRunner(threading.Thread):
|
|||||||
for C in concurrency_levels:
|
for C in concurrency_levels:
|
||||||
if self.should_stop():
|
if self.should_stop():
|
||||||
raise StopRequested()
|
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:
|
if warmup:
|
||||||
self._warmup(base_prompt, C)
|
self._warmup(base_prompt, C)
|
||||||
for i in range(1, n + 1):
|
for i in range(1, n + 1):
|
||||||
|
|||||||
Reference in New Issue
Block a user