当前位置:网站首页>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-06-30 08:44: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
边栏推荐
- Tidb v6.0.0 (DMR): initial test of cache table - tidb Book rush
- Flink SQL custom connector
- 2021-02-18
- 维基媒体基金会公布新商业产品“维基媒体企业”首批客户
- Is it safe to open an account? How can anyone say that it is not reliable.
- Redis design and Implementation (II) | database (deletion strategy & expiration elimination strategy)
- C#访问MongoDB并执行CRUD操作
- 从0开始构建一个瀚高数据库Docker镜像
- mysql基础入门 day4 动力节点[老杜]课堂笔记
- Tidb 6.0: making Tso more efficient tidb Book rush
猜你喜欢
随机推荐
Summary of common pytoch APIs
Introduction to MySQL basics day4 power node [Lao Du] class notes
Viteproject require Syntax Compatibility Problem Solving require is not defined
证券开户的优惠怎样才能得到?在线开户安全?
2021-02-27
在浏览器输入url到页面展示出来
挖财开户安全吗?怎么有人说不靠谱。
QT connection to Shentong database
Flink SQL 自定义 Connector
Redis design and Implementation (I) | data structure & object
[untitled]
Detectron2 source code reading 4-- registrar construction model
[untitled]
【NVMe2.0b 14】NVMe Admin Command Set
C # get the current timestamp
Interpretation of source code demand:a rotation equivariant detector for aerial object detection
[untitled]
【NVMe2.0b 14-2】Create/Delete Queue
Gilbert Strang's course notes on linear algebra - Lesson 1
TiDB 6.0:让 TSO 更高效丨TiDB Book Rush









