Sets whether to enable APM to collect performance monitoring data. If this parameter is set to false, APM stops collecting app performance data. The default value is true.<br>``启用APM监控、停用APM监控``|enableCollection(boolean enable)|[apms](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-References/apms)
#### Scenario: Scene frame rendering and loading performance monitoring``APM Game Plugin服务入口``
| Description | Api | Reference |
---|---|---
Start APM Game Plugin service.<br>``开始APM Game Plugin服务``|start()|
Stop APM Game Plugin service.<br>``停止APM Game Plugin服务``|stop()|
Start recording scene loading time.<br>``开始记录场景加载时间``|startLoadingScene(GameAttribute gameAttribute)|
Stop recording scene loading time.<br>``停止记录场景加载时间``|stopLoadingScene(string scene)|
Save current game properties.<br>``保存当前游戏属性``|setCurrentGameAttribute(GameAttribute gameAttribute)|
Set the reporting frequency of game performance data, unit: minute.<br>``设置游戏性能数据上报频率,单位:分钟``|setReportRate(int intervalMin)|
Whether to enable APM Game Plugin service.<br>``是否启用APM Game Plugin服务``|enableGamePlugin(boolean enabled)|
Before integrating the APM SDK, ensure that your app has integrated the AppGallery Connect SDK and AppGallery Connect plug-in. For details, please refer to [Getting Started with Android.](https://developer.huawei.com/consumer/en/doc/development/AppGallery-connect-Guides/agc-get-started)
**Note**:
**Note**:
1. Copy the `agconnect-services.json` file to `Assets/Plugins/Android/`
- Step 1: Create a repo from: https://github.com/Unity-Technologies/unity-hms_sdk/tree/apm and checkout to “apm” branch.
- Step 2: Replace `agconnect-services.json` file from your remote project and configure your gradle files, refer to Part 2. Step 1 to Step 3.
- Step 2: Replace `agconnect-services.json` file from your remote project and configure your gradle files, refer to Part 2. Step 1 to Step 3.
- Step 3: Open Unity Hub, add HuaweiServiceDemo Project (Unity version 2019.3).
> Microsoft (R) Visual C# Compiler version 2.9.1.65535 (9d34608e)
> Copyright (C) Microsoft Corporation. All rights reserved.
>
>
> error CS0009: Metadata file '/Users/yanmeng/Desktop/unity_agc_new/unity-hms_sdk/hmsDemo/Library/ScriptAssemblies/Unity.Timeline.Editor.dll' could not be opened -- Image is too small.
> Assets/HuaweiHms/src/hms/Wrapper/fundation/HmsClass.cs(72,25): warning CS0693: Type parameter 'T' has the same name as the type parameter from outer type 'HmsClass<T>'
- Step 6: build android apk and run on Android device. Use logcat to check whether test cases are executed successfully.