fix: bug in time statistics format#3136
fix: bug in time statistics format#3136Mixficsol merged 2 commits intoOpenAtomFoundation:unstablefrom
Conversation
|
Warning Rate limit exceeded@github-actions[bot] has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 25 minutes and 58 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (2)
✨ 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 (
|
* update zlib version * bug in time statistics format --------- Co-authored-by: wuxianrong <[email protected]>
#3131
pika3.5中该bug复现
原因分析
慢日志明确给出了 210 µs 的耗时,而 info all # Commandstats 对应的 usec_per_call 只有 0.21,这一千倍的差距说明统计值在输出前被 /1000 误换算成了毫秒,因此当前版本的 Commandstats 单位实际上是毫秒,符合 issue #3131 的描述。
修改位置
在 src/pika_admin.cc 中将 MethodofCommandStatistics 与 MethodofTotalTimeCalculation 里把 time_consuming / 1000.0 直接改为 static_cast(time_consuming),去掉这一步除法即可恢复为真正的微秒单位,重新编译后 info all 中的 usec 与 usec_per_call 将与 slowlog 完全一致。
修复后截图