Repository navigation
feat: 支持 Codex 用量统计、来源概览与增量缓存 - #1
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
问题与结果
原工具只解析 Claude Code 会话;改为同时统计本机 Codex 和 Claude Code,提供全部 / Claude Code / Codex 来源筛选。顶部概览同步改为总用量、Claude Code、Codex 和最近一小时速率;费用参考收起到次要位置。
加入 Codex 后,持续写入日志会让整个资料库缓存失效,约 2,000 个文件、4.54 GiB 的真实资料库每次查询要 13–16 秒。改为逐文件解析索引,只重读变化的文件;SQLite 保存可重建的统计数据,重启后复用。本机同一个查询重启后约 0.73 秒,后续约 0.01–0.20 秒;首次建立索引仍需约 8.47 秒。页面绘图耗时另计。
实现
验证
说明见 docs/codex-usage.md、docs/performance.md 与 ADR 001。