【发布时间】:2020-08-12 16:48:45
【问题描述】:
我想测量屏幕上的加载时间,这涉及多个 API 调用,因此除了 HTTP 跟踪之外还需要自定义跟踪。屏幕有一个分页的recyclerview,所以我需要多次运行跟踪。但是,这是行不通的。我收到类似的错误
Trace 'Home_Loading' has already started, should not start again! 当我第二次尝试运行它时,即使在调用 stop() 之后也是如此。比如这段代码
val startupTrace = FirebasePerformance.getInstance().newTrace("Home_Loading")
startupTrace.start()
startupTrace.stop()
startupTrace.start()
startupTrace.stop()
导致以下 logcat
E/FirebasePerformance: Trace 'Home_Loading' has already started, should not start again!
E/FirebasePerformance: Trace 'Home_Loading' has already stopped, should not stop again!
D/FirebasePerformance: Logging trace metric - Home_Loading 0.0220ms
启动/停止方法不是同步的吗?还是不能多次运行同一个跟踪?
【问题讨论】:
标签: android firebase firebase-performance