Reference materials for VC time-consuming monitoring

VC page loading monitoring is mainly divided into page interaction time and page rendering time

At present, the page interaction time is relatively uniform in iOS, that is, the time from viewDidLoad to viewDidAppear, but because the page rendering time is strongly related to the business, it is difficult to find a general solution. Here, the relevant information of the past few days is recorded for your reference.

References on page interaction time

A KVO-based page loading and rendering time-consuming monitoring method (this is the prototype of the algorithm, and the following articles are based on this)

https://www.colabug.com/2017/1127/1953419/

Clever use of KVO to achieve accurate VC time-consuming detection (this article optimizes the previous article and provides code examples)

https://punmy.cn/2018/06/18/15278496835424.html

iOS interface startup time-consuming detection (optimized again, added storage function)

https://www.jianshu.com/p/87c2a6c19bec

Implementation of iOS webpage loading time monitoring solution (mainly for webview, involving network callback)

https://blog.csdn.net/miaogehehe/article/details/80736971

iOS runtime actual combat, one-time solution to the pit of debugging the crematorium (use the first article for page access statistics and HOOK statistics, and the callback mechanism inside is recommended to learn)

https://www.jianshu.com/p/da32399c150a

References on Page Rendering Times

Use image recognition to automatically confirm that the webpage is successfully loaded (this is an idea that can be used for reference, but the false positive rate is high)

https://juejin.im/post/6844903455903973390

Some ideas of "non-intrusive page loading completion detection" (implemented with iOS and optimized)

http://m.udpwork.com/item/15991.html

A new way to detect page loading time (Borrowing from the above several solutions, adding view configuration, closer to the business)

https://www.codercto.com/a/61716.html

Mature APM project's solution for page loading monitoring

Meituan mobile terminal performance monitoring solution Hertz (Hertz specifies the tag of an element of the final rendered page in the configuration file, and opens CADisplayLink to check whether the element appears under the root node after the network request is successful), which is the time limit for page rendering. Monitoring solution, but it is a half-buried point

https://tech.meituan.com/2016/12/19/hertz.html

NetEase NeteaseAPM (the method of page monitoring is viewDidLoad, viewDidAppear, viewDidDisappear and other methods. If the page is too complex and takes a long time to render, the life cycle method of the page will be executed normally, and the status of the page can be accurately obtained. Slow loading is also diagnosed through page loading time ) is a monitoring solution for page interaction time, which may add some network time-consuming, because there is no open source, it is not sure

https://www.infoq.cn/article/netease-ios-sdk-neteaseapm-technology-share/?utm_source=articles_about_SDK&utm_medium=link&utm_campaign=SDK

Meitu open source tool set MTHawkeye (internal is divided  VC Life Trace into  ObjC CallTrace two parts. VC Life Trace It is used to track the specific time points of each stage of opening ViewController. ObjC CallTraceAfter it is turned on, it can track the Objective-C methods that take more than the specified threshold, similar to Instrument's Time Profiler function.) is a monitoring solution for page interaction time, which increases the acquisition of time-consuming stacks.

https://zhuanlan.zhihu.com/p/63284100

360 mobile terminal performance monitoring practice QDAS-APM (There is a method called viewDidLayoutSubviews in the life cycle method of UIViewController, which actually tells the time point when the layout of the subviews of the controller is completed. Generally, it will be called twice, in different operations The number of calls is also different in the system version.) It is a page rendering monitoring solution. The operation of calling twice is quite amazing, so study it carefully when you have time

https://www.jqhtml.com/47687.html

Ctrip wireless APM practice (page initialization starts, traverse all elements of the page, and detect text; if the coordinates of the text are in the head (20%)/tail (25%) area of ​​the page, ignore the Text >= 2 groups, and consider the detection successful; one round After the detection, if the detection is not successful, wait for 50ms for the next round of detection; the total detection time is 10s, otherwise it will time out) belongs to the page rendering scheme, which is similar to the proportion of the page, and is closely related to the business post.

https://cloud.tencent.com/developer/article/1586420

Tingyun APM (page interactive time: the time from the page opening to the user can interact normally. Android starts from onCreat/onStart to the end of onResume. iOS starts from viewDidLoad / viewWillAppear to the end of the last viewDidAppear. Page first screen time: page opening to content The time to complete the display (including network time consumption. From the beginning of the first life cycle method to the end of the last asynchronous call method returning to the main thread.) defines two schemes. How to distinguish the second asynchronous call is related to page rendering or Need to study, because there is no open source, it is not possible to determine

https://doc.tingyun.com/app/html/PageAnalysis.html

Xianyu Flutter page online performance data (the page loading time is determined by starting the timer after the container is initialized, checking the screen rendering degree when the container is laid out, and calculating the screen coverage of visible components, satisfying the conditions of >60% horizontally and >80% vertically It is considered that the filling degree of the page is satisfied, and then check the heartbeat of the main thread to determine whether the loading is complete) and the business post is relatively tight, and the principle is similar to the page ratio

https://www.yuque.com/xytech/flutter/qyr9wx
 

better open source library

FWDebug

https://github.com/lszzy/FWDebug/blob/master/README_CN.md

FORTY

https://github.com/ifgyong/FYMSL

MTHawkeye (Meitu Solution)

https://github.com/meitu/MTHawkeye

VCProfiler

https://github.com/panmingyang2009/VCProfiler

VCTimeProfiler

https://github.com/suxinde2009/VCTimeProfiler

Guess you like

Origin blog.csdn.net/killer1989/article/details/108099921