-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
feat: Log table show output speed #1302
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughThe changes standardize time measurement from seconds to milliseconds across several backend logging and quota functions, updating variable names and function signatures accordingly. The frontend log table now displays token processing speed (tokens per second) alongside use time, with new formatting and a revised column header to reflect these enhancements. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Frontend
participant Backend
participant Model
User->>Frontend: Initiate log view
Frontend->>Backend: Request logs
Backend->>Model: Fetch logs with useTimeMs (ms)
Model-->>Backend: Return logs (use_time in ms)
Backend-->>Frontend: Send logs (use_time in ms)
Frontend->>Frontend: Calculate tokens/sec (completion_tokens / use_time * 1000)
Frontend-->>User: Display speed (t/s) and use time (s)
Poem
📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (5)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings
relay/relay-text.go (1)
🔇 Additional comments (7)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
日志列表显示输出token的速度
如图,在日志列表增加了输出速度显示。
实现方案
计算方式:
总输出tokens / 总时长(包含首字时长)
此处计算的平均输出速度,没有扣除首字响应时长。可以讨论是否调整计算方式为从首字返回时开始计算。
改动范围
consumedTime
!!破坏性修改:用时字段,从秒改为毫秒。因为使用秒计算误差太大。并且为了日志中和首字响应时间统一起来都保留一位小数。
此处是破坏性修改,更新后会影响历史数据的时间显示和速度计算都会异常。如果考虑日志影响不大,可以直接升级。
此处可讨论,是否使用新字段,使用新字段就会导致logs表冗余无用字段。
Summary by CodeRabbit
New Features
Bug Fixes
Style