当前位置:网站首页>Use Huawei performance management service to configure the sampling rate on demand
Use Huawei performance management service to configure the sampling rate on demand
2022-07-02 11:00:00 【Huawei Developer Forum】
Android Huawei is used in the application AppGallery Connect Performance management services provided , Used for monitoring Android App Performance data for , Including commissioning APM When , From the log , Performance management SDK in , There's a lot of CPUMemoryEvent Events . For those who have not integrated performance management services, please refer to file coordination Github Demo Try to access .
from logccat According to the reported events , The frequency of reporting is still very high , Worry that the frequency of acquisition is too high , Will occupy the mobile phone CPU Resources for , The equipment and application are stuck . So we are studying how to configure performance management SDK Sampling rate .
The following steps and related screenshots are used to configure the sampling rate of Huawei performance management .
1、 Official document description :
First, check the Huawei documents , Documentation for configuring the sampling rate , Is in “ Add custom monitoring configuration ” Inside , It's hidden deep , Link address Click here to .
It mainly involves three parts , Set the session sampling rate 、 The front desk CPU Acquisition frequency 、 Memory acquisition frequency of the foreground .
2、 Configuration steps
1、 Configure the session sampling rate
First, let's introduce the conversation : Every time a user uses APP When , It's a conversation . Like you Application startup or App Switch to the foreground to start , To exit the application or switch to the background , It's a conversation
The session sampling rate refers to the probability of a session collection , The default is 1%. The higher the sampling rate , It will improve the probability of restoring the device information and user interaction track when the problem occurs ,
The configuration is as follows : Open the app's Manifest file , stay <application> The configuration inside the label is as follows data:
<meta-data
android:name="sessions_sampling_percentage"
android:value="1.0" />
The number represents the percentage .
2、 Configure the application in the foreground CPU Acquisition frequency
The meaning of the name is easy to understand , Configuration App At the front desk CPU Sampling rate .
Open the app's Manifest file , stay <application> The configuration inside the label is as follows data:
<meta-data
android:name="collect_cpu_frequency_fg_ms"
android:value="100" />
The numerical unit is ms, The configuration above is 100ms, each 100ms Take a sample .
3、 Configure the memory acquisition frequency of the application in the foreground
Configuration App Backstage CPU Sampling rate , Generally, the configuration is a little lower , Prevent occupation CPU resources .
<meta-data
android:name="collect_memory_frequency_fg_ms"
android:value="200" />
The unit of numbers is also ms, For example, I wrote above , It's every 200ms Take a sample .
For more details , Please see the :
Huawei official website :
https://developer.huawei.com/consumer/cn/forum/topic/0201640794525030131?fid=0101271690375130218?ha_source=zzh
边栏推荐
- (五)APA场景搭建之挡位控制设置
- Dialogue Wu Gang: why do I believe in the rise of "big country brands"?
- 二叉树专题--AcWing 1589. 构建二叉搜索树
- 主键策略问题
- Point cloud projection picture
- PCL之K-d树与八叉树
- 14. Code implementation of semaphore
- 洛谷 P1892 [BOI2003]团伙(并查集变种 反集)
- [AI application] Hikvision ivms-4200 software installation
- 洛谷 P5536 【XR-3】核心城市(贪心 + 树形 dp 寻找树的中心)
猜你喜欢
随机推荐
华为快应用中如何实现同时传递事件对象和自定义参数
UVM learning - build a simple UVM verification platform
Shell programming 01_ Shell foundation
2. Hacking lab script off [detailed writeup]
[SUCTF2018]followme
华为AppLinking中统一链接的创建和使用
PCL extracts a subset from a point cloud
JVM之垃圾回收器
二叉树专题--AcWing 3540. 二叉搜索树建树(实用板子 构建二叉搜索树 并输出前、中、后序遍历)
Session cookies and tokens
MongoDB 学习整理(条件操作符,$type 操作符,limit()方法,skip() 方法 和 sort() 方法)
MySQL lethal serial question 4 -- are you familiar with MySQL logs?
Overview of integrated learning
Easyexcel, a concise, fast and memory saving excel processing tool
618 what is the secret of dominating the list again? Nike's latest financial report gives the answer
Point cloud projection picture
OpenMLDB Meetup No.4 会议纪要
PCL Eigen介绍及简单使用
【快应用】text组件里的文字很多,旁边的div样式会被拉伸如何解决
简洁、快速、节约内存的Excel处理工具EasyExcel