1 The project encountered a crash/carton/ANR/OOM/slow startup 1
1.1 Project background 2
1.2 Challenges encountered 3
1.3 Steps to solve the problem 4
1.4 Project Summary 5
Product experience content: integration/access/use 6
2.1 Integration/Access/ Umeng + Application Performance Monitoring Platform U-APM 7
2.2 Integration/Access/Using Experience Summary and Sharing 8
2.3 Suggestions/Opinions on the Product 91. The crash/stuttering/ANR/OOM/slow startup encountered by the project
1.1 Project background
The project background is mainly the company development project, the boss raises the demand, the product manager plans the demand and the document, the developer plans the development according to the demand, the project developer (two front-end development, three Java development, two testing, one product, one ui ); Project organization structure:
(Mini Program/H5): uniapp architecture + U-APM monitoring statistics + canvas drawing poster
B-side management system: Vue+Axios+Elementui+ueditor135 editor+
The name of the project is: Worth Buying Mall, which is mainly an integrated B2C platform, including an internal mall management system (customer service/operations can publish activities and products in the system, manage products, orders, members, and handle user inquiries and complaints) , C-side small program APP (H5, APP directly provides users with a convenient introduction, an online shopping platform with more benefits and more discounts, and fission occurs through sharing of event discounts and local push methods, and captures different users through Youmeng statistics. The project is similar to Jingdong Mall and Tmall Mall. You can browse products and place orders in the mall. Member users and star-rated users can participate in various activities.
E-commerce model:
1.1: B2B: business to business. Such as Alibaba, Huicong.com, Mingwan.com.
1.2: B2C: business to user. Such as Jingdong.
1.3: C2C: user to user. Such as Taobao.
1.4: B2B2C: business to business to user. Such as Tmall.
1.5: O2O: online to offline. For example, Baidu Waimai, Meituan, Are you hungry?1.2 Challenges/problems encountered
1. The project is online, such as code exceptions or console exceptions that cannot be monitored, which is not easy to troubleshoot
2. One of the server-side queue interfaces crashes directly when the project hangs
3. Similar login button click request frequently click request multiple times
4. The inconsistency of page components leads to multiple changes in requirements
5. Switching environment or project distance configuration causes abnormal axios interception failure1.3 Steps to solve the problem
- The fundebug third-party plug-in introduced in the initial project development monitors code exceptions, but some intercept exceptions cannot be caught {H5 and small programs use fundebug, APP uses U-APM of Youmeng to access and capture exceptions}
- First, check the deviation of the abnormal area captured by the third party, use the developer tool to debug the debugger to check the location of the abnormality, check whether it is a code logic problem or other abnormality, and then go to troubleshoot and solve it in turn
1.4 Project summary
When you encounter a problem, don’t be anxious or panic. Now that the problem has occurred, investigate it according to the time, method, and situation of the problem. After you find the problem, try to solve it step by step. You will encounter weird problems. If you do it with your heart, it’s OK. Part of the module projects such as system tables, forms, website lists, title bars, etc. should be packaged and integrated as a component library for unified management, reducing the workload and Code redundancy.
2. Product experience content: integration/access/use
Here is a talk about the U-APM integrated access and usage method of Umeng. First of all, I will first explain why I personally chose Umeng’s product api to be used in the project during development. In the steps of solving the problem, I As mentioned, a third-party fundebug used by the h5 and applet in the project to capture and capture exceptions, APP development uses U-APM to capture capture error exceptions and listen, {fundebug capture exceptions and monitoring is not as comprehensive as U-APM , U-APM can only monitor normal exceptions, U-APM can monitor crash analysis, custom error exceptions, start analysis, freeze analysis to the number of people affected, etc.}, the only drawback is that U-APM only supports Android and IOS
2.1 Product experience content: integration/access/use
2.1.1 First enter the website to log in to the registered application to obtain the download SDK
U-APM website address https://apm.umeng.com/apps/create
2.1.2 Get your own application key and basic SDK
Notice:
• The Android version and iOS version of the app cannot use the same AppKey and need to be registered separately.
• [Youmeng+] The application name has nothing to do with the actual application name and package name. If the application name already exists when registering the application, it is recommended to name it as application name + platform (iOS/Android).
Maven automatic integration (recommended)
Import the latest version of the componentized statistics SDK by adding the maven online dependency in the Android Studio project build.gradle configuration script.
Maven dependency configuration
Add [Youmeng+] SDK new maven warehouse address in the buildscript and allprojects sections of the project build.gradle configuration script.
maven { url 'https://dl.bintray.com/umsdk/release' }
buildscript { repositories { google() jcenter() maven { url 'https://dl.bintray.com/umsdk/release' } } dependencies { classpath 'com.android.tools.build:gradle:3.4.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } allprojects { repositories { google() jcenter() maven { url 'https://dl.bintray.com/umsdk/release' } } }
Add the statistics SDK library and other library dependencies in the dependencies section of the project App corresponding build.gradle configuration script:
// The following SDKs are introduced on demand based on whether the host App uses related services.
// OAID is currently the mainstream Android Q device identification in the domestic market, and can be selected according to needs.
// Umeng Statistics SDK implementation'com.umeng.umsdk:common:9.3.3'
// Version number (required) implementation'com.umeng.umsdk:asms:1.1.4'
// asms package dependency (required) implementation'com.umeng.umsdk:game:9.2.0+G'
//Game statistics SDK dependency (optional) implementation'com.umeng.umsdk:apm:1.1.0'
// U-APM product package dependency (required)
Crash/ANR type
If you are using the SDK version 9.0.4 or higher, and the umeng-apm-vx.xxaar plug-in is integrated, the stability function of the new version will be enabled by default
-keep class com.uc.* {;}
If the developer catches the error by himself, it needs to be uploaded to the [Youmeng+] server manually. The following two methods can be called:
@param {e} error exception
@param{type} custom error type
public static void UMCrash.generateCustomLog(Throwable e, String type)
Method one example:
try {// The code that throws the exception}
catch (Exception e) {
UMCrash.generateCustomLog(e, "UmengException"); }
Method Two:
@param {e} error exception
@param{type} custom error type
public static void UMCrash.generateCustomLog(String e, String type)
Capture successful view Umeng + U-APM visualization tool:
The detailed document view official release document is clearer and clearer:
https://developer.umeng.com/docs/193624/detail/194590
2.2 Integration/Access/Using Experience Summary and Sharing
First of all, let's talk about the current market: There are many reasons for the poor performance of the App. Excluding the external factors of the device hardware and software, most of them are caused by the incorrect use of lines, system functions, programming paradigms, and data structures by developers. Even more experienced programmers can hardly avoid all the "pits" that lead to low performance during development. Therefore, the key to solving performance problems is whether these errors can be found, located and caught as early as possible. With the increasing of App business, each system is becoming more and more complex, the calls between services, service dependence, and the performance of analysis services are becoming more and more difficult. Therefore, the introduction of a performance monitoring platform is particularly important. The ability to quickly, accurately, and abundantly locate error types is the most important factor in measuring performance monitoring products. Take U-Meng+’s U-APM application performance monitoring platform as an example. Whether it’s Java, Native crashes, ANR, various system killings, etc., U-APM can capture abnormal problems and generate complete and rich content. , Comprehensive log. As App developers, I believe you must have encountered similar embarrassing problems: failures are always told to you by your customers, and you can’t be sure when it happened. You can only push back the time point through customer feedback. Later, relatively complete log information can be obtained from the error log. For example, Umeng + application performance monitoring platform U-APM can reach the channels such as email, Dingding, corporate WeChat, Feishu, etc. Among them, the latter three can directly send monitoring alarms to the group through webhook, so that the research and development students in the group can obtain effective information in time, and change the abnormality and fix it in time. Personally, I think it is good enough for personal development or enterprise application development.
2.3 Suggestions/opinions on the product
As a developer’s suggestion to U-APM:
1. Log in to an account and you can have a choice platform to switch ios/Android to directly see the statistics of the corresponding data. Now it is a bit troublesome to toss back and forth
2. The current monitoring of statistical error exceptions only supports IOS and Android apps, applets, H5 and official accounts, which are currently not supported
3. It would be better if there is a screen recording function from the monitored abnormality, so you will directly check the screen recording playback effect.~~~~
Author: Zhao Ruifeng
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。