fix some bugs and add time trace #428
Merged
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.
Summary
时间追踪报告输出样式
========== 时间追踪报告 ==========
TraceId: Y1EF421EB6D0D3-0000000000000063
ChannelId: 99
PayloadSize: 667 KB
时间线:
[13:01:07.845] 请求开始
[13:01:07.848] 序列化完成 (+3 ms)
[13:01:07.848] 开始等待Channel可写 (+3 ms)
[--:--:--.---] Channel变为可写 (超时! Channel一直不可写)
[--:--:--.---] 收到响应 (未收到! 超时)
[13:01:14.852] 请求结束 (总耗时: 7007 ms)
耗时分析:
用户线程序列化: 3 ms
准备发送: 0 ms
★ 等待Channel可写: 7004 ms [!!!超时! 发送缓冲区一直满!!!]
========== 时间追踪报告 ==========
TraceId: Y1EFFA1EB6D0FA-0000000000000003
ChannelId: 3
PayloadSize: 4667 KB
时间线:
[14:57:27.573] 请求开始
[14:57:27.882] 序列化完成 (+309 ms)
[14:57:27.890] 提交到Netty (+317 ms)
[14:57:35.100] EventLoop开始编码 (+7527 ms) ← 关键!队列等待了 7.2 秒
[14:57:35.150] EventLoop编码完成 (+7577 ms)
[--:--:--.---] 收到响应 (未收到! 超时)
[14:57:36.100] 请求结束 (总耗时: 8527 ms)
耗时分析:
用户线程序列化: 309 ms
提交到Netty: 8 ms
★ Netty队列等待: 7210 ms [!!!可能阻塞!!!] ← 问题定位!
EventLoop编码耗时: 50 ms
网络+服务端处理: 超时 (编码完成后等待 950 ms 未收到响应)
Solution Description