Code Monkey home page Code Monkey logo

Comments (10)

791045873 avatar 791045873 commented on July 30, 2024

还以为给出了子路由渲染时间的无入侵上报方式。。。。

from blog.

forthealllight avatar forthealllight commented on July 30, 2024

还以为给出了子路由渲染时间的无入侵上报方式。。。。

你看上一篇文章就是介绍切换路由时的,无痕上报

from blog.

 avatar commented on July 30, 2024

能否解答下 “就是如果页面销毁,那么对应的ajax方法并不一定能成功发送。“ 这个的原因是什么

from blog.

791045873 avatar 791045873 commented on July 30, 2024

能否解答下 “就是如果页面销毁,那么对应的ajax方法并不一定能成功发送。“ 这个的原因是什么

你在发送一个请求的时候,页面如果刷新了(也就是销毁后重新挂载),请求会被浏览器cancle掉,你可以在network里自己看一下

from blog.

8427003 avatar 8427003 commented on July 30, 2024

何时上报这个我有点疑惑,作者能解释下吗?

举个例子,我们通常非常关系白屏时间和资源加载时间这两个指标。

白屏时间
不靠performance API 是拿不到的。所以很多都是trick 方式拿,比如在body标签开头处埋点,咱们近似认为用户开始看到了内容。

资源加载时长更蛋疼。
非单页应用靠window的onLoad 事件,onLoad事件到达,我们开始上报,一个资源不漏。而单页应用你说在切换路由时上报。切换路由,所有资源开始加载,如果遇到弱网环境,资源加载时长无法判断。所以切换路由立即上报,与过一个超时时间上报都是不准确的。请问这种场景下的具体策略是什么?

from blog.

volcano0107 avatar volcano0107 commented on July 30, 2024

如果需要上报切换路由情况下每一个子页面重新render的时间,需要自定义上报
请问如何自定义上报呢?

from blog.

forthealllight avatar forthealllight commented on July 30, 2024

如果需要上报切换路由情况下每一个子页面重新render的时间,需要自定义上报
请问如何自定义上报呢?

这个就比较复杂了,推荐可以结合react或者vue生命周期来搞,在重新update的时候打点几个时间,然后在didUpdate的时候上报。如果不结合MVC框架的生命周期,原声dom的话有一些render的算法

from blog.

jiyuyu avatar jiyuyu commented on July 30, 2024

我理解统计单页应用性能数据最难的点在于抓上报的时间节点,什么时候才是有效数据渲染完毕,这个点是比较复杂的

from blog.

mutouafangzi avatar mutouafangzi commented on July 30, 2024

能看到项目的代码吗?是一拿到数据就上报吗,还是先存储再上报?

from blog.

chenglirui avatar chenglirui commented on July 30, 2024

这个就比较复杂了,推荐可以结合react或者vue生命周期来搞,在重新update的时候打点几个时间,然后在didUpdate的时候上报。如果不结合MVC框架的生命周期,原声dom的话有一些render的算法

如果需要上报切换路由情况下每一个子页面重新render的时间,需要自定义上报
请问如何自定义上报呢?

这个就比较复杂了,推荐可以结合react或者vue生命周期来搞,在重新update的时候打点几个时间,然后在didUpdate的时候上报。如果不结合MVC框架的生命周期,原声dom的话有一些render的算法

原生dom的话有一些render的算法,这个怎么去计算:网络开销、服务请求的开销以及DOM解析开销呢

from blog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.