Skip to content

feat(web): show cache hit rates in request logs - #618

Open
ryanchou1994 wants to merge 1 commit into
tbphp:mainfrom
ryanchou1994:feat/log-cache-hit-rate
Open

feat(web): show cache hit rates in request logs#618
ryanchou1994 wants to merge 1 commit into
tbphp:mainfrom
ryanchou1994:feat/log-cache-hit-rate

Conversation

@ryanchou1994

Copy link
Copy Markdown
Contributor

关联 Issue / Related Issue

Closes #583

变更内容 / Change Content

  • Bug 修复 / Bug fix
  • 新功能 / New feature
  • 其他改动 / Other changes

请求日志的 Token 单元格现在直接显示缓存命中率,不需要先悬停。百分比放在输入/输出 Token 下方,沿用现有的 formatCacheHitRate;缓存读写明细仍可通过悬停或键盘聚焦查看。

无缓存或缺少用量的记录不增加缓存行;只有缓存写入时显示 0%,无法计算比例时沿用 。三份 README 同步说明这项显示能力。没有修改 API、存储或缓存率计算方式。

验证:

  • Linux make check 通过(Go 1.27.1、Node 24.20.0、pnpm 11.17.0;断网测试容器,提供 Docker Compose CLI 与 jq,仅验证配置,不连接 Docker daemon)。
  • 使用真实 LogsTab 和合成请求日志检查英文、中文、日文,以及管理员和 AccessKey 视图;1360/1024/390px 布局内百分比可见,详细提示仍可通过悬停与键盘聚焦打开。涵盖缓存读取、仅写入、无缓存、零输入、partial/missing/not applicable 和大整数。

自查清单 / Checklist

  • 我已运行 make check,或在说明中写明无法运行的原因和未验证范围。 / I ran make check, or documented why it could not run and what remains unverified.
  • 本 PR 范围聚焦,未包含无关改动。 / This PR is focused and contains no unrelated changes.
  • 我已更新必要的公开文档或发布说明。 / I updated any required public documentation or release notes.
  • 我已确认提交、日志和测试数据不包含敏感信息。 / I confirmed that commits, logs, and fixtures contain no sensitive data.
  • 如适用,我已说明兼容性或数据迁移影响。 / Where applicable, I documented compatibility or data-migration impact.

Copilot AI lite review requested due to automatic review settings September 10, 2026 15:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@coderabbitai

coderabbitai Bot commented Sep 10, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: QUIET

Plan: Advanced

Run ID: 34c54370-3b99-4985-90a7-56c22803150a

📥 Commits

Reviewing files that changed from the base of the PR and between f091528 and 1a90b5e.

📒 Files selected for processing (4)
  • README.md
  • README_CN.md
  • README_JP.md
  • web/src/features/monitor/LogsTab.vue

Included review availability: Your plan provides up to 8 included reviews per hour; 7 remain after this review.


📝 Walkthrough

Walkthrough

更新日志列表的缓存详情按钮位置。按钮从 in token 行移至 out token 行之后,并同时显示 formatCacheHitRate 返回的缓存命中率和 Layers 图标。新增对应样式。README、README_CN.md 和 README_JP.md 同步补充日志列表显示缓存命中率的说明。

Merge Risk: ⚪ Minimal · up to 1a90b

This adds inline cache hit rates to request logs without changing API, storage, or cache calculations. The change is ready to merge with no current merge-blocking risk.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed 标题准确概括了主要变更:在请求日志中显示缓存命中率。标题简洁且与代码和文档修改一致。
Description check ✅ Passed 描述包含关联 Issue、变更内容、验证结果和完整自查清单。描述明确说明了缓存状态、兼容性影响及未修改的 API、存储和计算逻辑。
Linked Issues check ✅ Passed PR 满足 Issue #583 的核心目标:请求日志直接显示缓存命中率,不再仅通过悬停查看。实现覆盖 Token 单元格、相关语言界面和目标 2.x 版本线。
Out of Scope Changes check ✅ Passed 代码变更集中在 LogsTab.vue 的缓存命中率展示,文档变更同步说明该功能。未发现与 Issue #583 无关的代码或配置修改。
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0…

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

DabengBa added a commit to DabengBa/gpt-load that referenced this pull request Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

请求日志直观显示缓存率

2 participants