【发布时间】:2021-07-10 09:31:00
【问题描述】:
所以,我想试用 Sentry 的 withProfiler 组件,看看它是如何报告组件性能的。我按照以下示例进行操作:
https://docs.sentry.io/platforms/javascript/guides/react/#monitor-performance
唯一的区别是组件是使用 redux compose() 导出的。所以对于 Sentry,它看起来像这样:
export default compose(
withStuff,
withMoreStuff,
Sentry.withProfiler,
connect(mapStateToProps)
)(App);
我还尝试包装一个简单的计数器应用程序。只是看看它是否可以在没有 redux 的情况下工作。
然后我访问了我的页面,并观看了组件渲染。我希望在项目绩效仪表板中看到一些东西。我看到了 react.mount 的时机。但是没有 react.render 或 react.update,即使文档表明它应该被追踪。
https://docs.sentry.io/platforms/javascript/guides/react/components/profiler/
有人知道我做错了什么吗?
谢谢!
【问题讨论】:
标签: javascript reactjs performance sentry