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.
背景
生产环境中当应用路由复杂度比较高时,仅靠
cpuprofile
只能看到离散的函数调用栈,特别是一些底层的例如 db 操作库无法映射到对应的逻辑,从而使得性能问题分析变得棘手。方案
本 PR 增加了一个
enable_http_profiling
参数,默认为false
。其开启后,会在 CPU Profiling 时同步执行 HTTP Profiling,这样可以将 CPU 采样按照时间维度的分析结果,和同一时刻的 HTTP 请求信息进行比对,从而缩小性能问题的定位范围。close #213