Skip to content
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

feat: support http profiling #215

Merged
merged 4 commits into from
Dec 9, 2022
Merged

feat: support http profiling #215

merged 4 commits into from
Dec 9, 2022

Conversation

hyj1991
Copy link
Member

@hyj1991 hyj1991 commented Dec 8, 2022

背景

生产环境中当应用路由复杂度比较高时,仅靠 cpuprofile 只能看到离散的函数调用栈,特别是一些底层的例如 db 操作库无法映射到对应的逻辑,从而使得性能问题分析变得棘手。

方案

本 PR 增加了一个 enable_http_profiling 参数,默认为 false。其开启后,会在 CPU Profiling 时同步执行 HTTP Profiling,这样可以将 CPU 采样按照时间维度的分析结果,和同一时刻的 HTTP 请求信息进行比对,从而缩小性能问题的定位范围。

close #213

@fengmk2
Copy link
Member

fengmk2 commented Dec 8, 2022

越来越高级了。

@hyj1991
Copy link
Member Author

hyj1991 commented Dec 8, 2022

越来越高级了。

贴合语雀业务的性能问题,反馈到工具链上的一个 Case

@codecov
Copy link

codecov bot commented Dec 8, 2022

Codecov Report

Merging #215 (78a1704) into master (85065b8) will not change coverage.
The diff coverage is 100.00%.

❗ Current head 78a1704 differs from pull request most recent head a4f0183. Consider uploading reports for the commit a4f0183 to get more accurate results

@@            Coverage Diff            @@
##            master      #215   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           10        10           
  Lines          305       317   +12     
=========================================
+ Hits           305       317   +12     
Impacted Files Coverage Δ
lib/configure.js 100.00% <100.00%> (ø)
lib/utils.js 100.00% <100.00%> (ø)
patch/http.js 100.00% <100.00%> (ø)
xprofiler.js 100.00% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@hyj1991 hyj1991 merged commit bfe59c1 into X-Profiler:master Dec 9, 2022
@hyj1991 hyj1991 mentioned this pull request Dec 11, 2022
hyj1991 added a commit that referenced this pull request Dec 11, 2022
Commits:

  - [bfe59c1] feat: support http profiling (#215)
  - [85065b8] refactor: config (#214)
  - [ea2e7f8] fix: avoid copying constant strings (#212)
  - [5b157fe] fix: remove unused dump action field (#211)
  - [840df2a] refactor: consolidate dump actions (#210)
  - [289770f] refactor: js bindings (#209)

PR-URL: #216
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[WIP] 增加 HTTP profiling
2 participants