feat: 添加日志表格输出速度 (tokens/s) 计算字段 - #4237
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (9)
✅ Files skipped from review due to trivial changes (7)
🚧 Files skipped from review as they are similar to previous changes (2)
WalkthroughAdded a new "速度" (Speed) column to usage logs; the hook computes per-log speed as completion_tokens / (use_time - first_response_time) and the column renders the formatted value for specific log types, with i18n entries added for label and formula. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant UsageLogsHook as Hook
participant UsageLogsTable as Table
participant I18n as i18n
User->>Table: open usage logs
Table->>Hook: request logs data
Hook->>Hook: compute per-log `speed` (completion_tokens / (use_time - frt))
Hook-->>Table: return logs with `speed`
Table->>I18n: get label/tooltip text
Table->>User: render rows with Speed column (conditional)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
|
@seefs001 麻烦大佬抽空看看,只是在前端日志加个计算列,用于显示token速度,小改动 |
25077e7 to
706b122
Compare
|
已 rebase 到最新 main 并解决冲突,当前可合并。PR 仅在前端日志表格新增一个 tokens/s 计算列,纯展示逻辑。@t0ng7u 麻烦抽空 review 一下 🙏 |
Summary
/console/log使用日志表格中新增「速度」列,显示 LLM 输出的 tokens/s 指标completion_tokens / (use_time - frt/1000),即输出 token 数除以首字后的生成耗时Closes #717
Changes
UsageLogsColumnDefs.jsxuseUsageLogsData.jsxweb/src/i18n/locales/*.jsonTest plan
/console/log,确认「速度」列显示在「输出」和「花费」之间-Summary by CodeRabbit