在 React JS 中,我们如何在没有 Profiler API 的情况下分阶段捕获组件渲染

问题描述 投票:0回答:1

我想捕获组件渲染时间阶段,比如组件在浏览器中渲染 UI 需要多少时间。 我尝试使用 Profiler API https://legacy.reactjs.org/docs/profiler.html - 它给了我所需的结果, 但不推荐用于生产。 有没有办法在没有 Profiler API 的情况下实现这一目标? 我还需要在 dataDog 中创建一个图表,这次我可以在其中显示

reactjs profiler datadog
1个回答
0
投票

既然你已经在使用 Datadog,你应该考虑 Real User Monitoring。有一个 React 集成,可以很容易地开始从您的 React 应用程序接收跟踪、浏览器事件 和日志

© www.soinside.com 2019 - 2024. All rights reserved.