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

refactor: replace dump actions static storages with EnvironmentData #202

Merged
merged 3 commits into from
Oct 12, 2022

Conversation

hyj1991
Copy link
Member

@hyj1991 hyj1991 commented Oct 12, 2022

背景

目前的 dump.cc 中实现的采样动作,依赖全局变量处理,存在两个问题:

  • 对于 worker_thread / main js thread 间并发调用各种 action 不友好
  • 需要进行退出前未完结采样动作立即结束并输出文件时由于 dtor 的问题会使得变量信息丢失

此 PR 将 actions 中涉及到的变量放置到 EnvironmentData 实例中存储,解决上述问题。

测试

局部逻辑重构,依靠现有 command.test.js 保证功能没有 break。

Reference: #202

@codecov
Copy link

codecov bot commented Oct 12, 2022

Codecov Report

Merging #202 (e4d8570) into master (7608a86) will not change coverage.
The diff coverage is n/a.

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

@@            Coverage Diff            @@
##            master      #202   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            9         9           
  Lines          296       296           
=========================================
  Hits           296       296           

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

@hyj1991 hyj1991 requested a review from legendecas October 12, 2022 07:05
src/commands/dump.cc Outdated Show resolved Hide resolved
@hyj1991 hyj1991 merged commit 6a1701f into X-Profiler:master Oct 12, 2022
@hyj1991 hyj1991 mentioned this pull request Oct 22, 2022
hyj1991 added a commit that referenced this pull request Oct 22, 2022
Commits:

  - [2f700fd] docs: update readme (#207)
  - [f4eb960] feat: support node-v19.x (#206)
  - [333593e] chore: make test more reliable (#205)
  - [c574ca2] feat: save Elf BuildId in corefile. (#204)
  - [b779aa2] feat: support finish profiling before process exit (#203)
  - [6a1701f] refactor: replace dump actions static storages with EnvironmentData (#202)
  - [7608a86] fix: ignore clean error (#200)
  - [2a6eaba] chore: static dispatch on dumpaction (#199)
  - [7d3fbb2] optimize: take action (#198)
    
PR-URL: #208
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.

2 participants