diff --git a/CHANGELOG.md b/CHANGELOG.md index 6cc0870..2de9913 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,23 @@ # CHANGELOG +## 2026-10-23 · 调用日志列表加「缓存命中」列(2.9.8 → 2.9.9) + +老板:「调用日志的命中缓存率为什么一直都是 0」。 + +**先给结论:数据没坏,是列表上看不到这一列。** 缓存命中率一直只在**详情弹窗**里显示, +列表没有;而 admin 自己那几条测试请求都是 38~41 token 的短提示词,上游不会缓存 → +所以看起来"一直是 0"。真实业务的调用是命中的。 + +实测(同一时刻库里的 107 条带 token 记录): +- **命中 62 条 / 未命中 45 条** +- 命中组:最低 11.1%、**中位 83.9%**、最高 99.7% +- 未命中组:输入 38 ~ 60192 token(短提示词不触发上游缓存;长提示词的前缀不一致也不命中) + +改动: +- 调用日志列表新增「缓存命中」列(在耗时之后):显示 `命中量 / 命中率%`, + 量按 k/M 缩写,命中率按档位配色(≥50% 绿、>0 黄、0 淡显)。 +- 数据直接取列表接口已返回的 `tok_cached` / `tok_prompt`,无额外查询。 + ## 2026-10-23 · 视频轮询时间线落库(2.9.7 → 2.9.8) 老板:「视频任务的轮询时间线也要落库」。 diff --git a/app/main.py b/app/main.py index 3043a46..fe62cd0 100644 --- a/app/main.py +++ b/app/main.py @@ -355,7 +355,7 @@ _docs_on = config.server.docs_enabled # 安全默认关(report: /docs、/ope # 2026-09-30: 2.6.1 → 2.7.0(按老板要求整个删除「火山方舟 Coding Plan」供应商:配置/模型/代码/文档/前端下拉/环境变量全清)。 # 2026-09-30: 2.7.0 → 2.7.1(界面提示白话化:熔断器→供应商自动保护、引擎→运行环境、slug→标识;删 120 个未引用死键)。 # ★ 版本号纪律:每次改动都要往上加,小改动加小版本号、大改动加大版本号(README 有专章)。 -VERSION = "2.9.8" +VERSION = "2.9.9" app = FastAPI( title="API Gateway", diff --git a/frontend/src/locales/en.ts b/frontend/src/locales/en.ts index e887d55..b99a977 100644 --- a/frontend/src/locales/en.ts +++ b/frontend/src/locales/en.ts @@ -244,6 +244,7 @@ export default { colFailRate: 'Fail rate', colModels: 'Models', colContent: 'Content', + colCache: 'Cache hit', }, users: { diff --git a/frontend/src/locales/zh.ts b/frontend/src/locales/zh.ts index ffbdff9..83b1594 100644 --- a/frontend/src/locales/zh.ts +++ b/frontend/src/locales/zh.ts @@ -244,6 +244,7 @@ export default { colFailRate: '失败率', colModels: '模型数', colContent: '内容', + colCache: '缓存命中', }, users: { diff --git a/frontend/src/views/CallLogs.vue b/frontend/src/views/CallLogs.vue index bad23d6..867fee3 100644 --- a/frontend/src/views/CallLogs.vue +++ b/frontend/src/views/CallLogs.vue @@ -62,6 +62,16 @@ + + + +