Firebase应用启动时间分析在Android上如何工作? [英] How does Firebase app start time profiling work on Android?

查看:80
本文介绍了Firebase应用启动时间分析在Android上如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我注意到Firebase Performance Monitoring确实提供了一些自动跟踪,盒子.特别是我正在查看冷启动应用程序的开始时间跟踪,这正是我现在需要做的.不幸的是,我需要获取更多的细粒度数据,因此我一直想自己可以做到,但是到目前为止,我还没有找到一个合理的方法来衡量Android应用程序的真正冷启动时间(考虑两次点击之间的时间).启动器中的一个图标,并查看给定Activity的用户界面.

I noticed that Firebase Performance Monitoring does provide some automatic traces out of the box. In particular I was looking at the cold app start time trace which is exactly what I need to do right now. Unfortunately I need to do have more granular data, so I was thinking I could do it on my own, but so far I failed to come up with a reasonable how to measure a true cold start time of an Android app (think time between tapping an icon in launcher and seeing the UI of given Activity).

文档说,调用 FirebasePerfProvider.onCreate 回调时,Firebase会启动跟踪.据我所知,这应该在应用程序进程启动后很快发生,所以很好,但这也意味着即使应用程序刚刚收到通知(或一般来说是一些广播),它也会被调用,并且此时该进程可能不会在用户实际打开应用程序时终止.这意味着它会测量持续时间错误.

The docs says, that Firebase starts the trace when FirebasePerfProvider.onCreate callback gets called. As far as I know this should happen very soon after the application process starts, so that's good, but it also means that it gets called even when the app just receives a notification (or some broadcast in general) and at that point the process might not be terminated by the time the user actually opens the app. That means it'd measure the duration wrong.

鉴于该SDK尚未(尚未?)是开源的,所以我找不到关于它如何工作的更好描述.

Given the SDK is not (yet?) open sourced, I could not find a better description of how this works.

有人知道更多吗?

推荐答案

如果通过Service或BroadcastReceiver启动了Android进程,则不会启动任何跟踪.因此,如果在该过程中实际启动了Activity,那么看起来似乎很长的应用启动跟踪就不会出现问题.仅当活动由Activity调用时,才会发生应用启动跟踪.

If the Android process is launched via a Service or BroadcastReceiver, no trace is started. So, if and when an Activity is actually started in that process, there will be no problems with an app start trace that could appear to be very long. The app start trace only happens if the process is invoked by an Activity.

我已经更新了文档以包含这一事实,并且更改应尽快发布.

I've updated the documentation to include this fact, and that change should be published soon.

这篇关于Firebase应用启动时间分析在Android上如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆