X-Profiler / xprofiler

🌀An addon for node.js, which supporting output performance log and real-time profiling through sampling.
Other
425 stars 57 forks source link

refactor: replace dump actions static storages with EnvironmentData #202

Closed hyj1991 closed 2 years ago

hyj1991 commented 2 years ago

背景

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

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

测试

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

Reference: https://github.com/X-Profiler/xprofiler/pull/202

codecov[bot] commented 2 years ago

Codecov Report

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

:exclamation: 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           

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