fix:bug in time statistics format#3134
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 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 (
|
This reverts commit aebff77.
#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 完全一致。
修复后截图