-
Notifications
You must be signed in to change notification settings - Fork 344
0x02b Apply AndroidGodEye for Release_en
hui.zhao edited this page Mar 27, 2020
·
9 revisions
You may want to use AndroidGodEye to monitor the real user's app performance in the production environment. Generally, you can call the observeModule
method to consume datas and report to the server in the callback:
try {
GodEye.instance().observeModule(GodEye.ModuleName.HEAP, new Consumer<HeapInfo>() {
@Override
public void accept(HeapInfo heapInfo) throws Exception {
// You can upload datas to server
Log.d("AndroidGodEye",String.valueOf(heapInfo));
}
});
} catch (UninstallException e) {
e.printStackTrace();
}
release {
resValue("bool", "android_god_eye_need_notification", "false") // close notification
resValue("string", "android_god_eye_install_assets_path", "android-godeye-config/release_install.config") // specify different module config
}
Because some modules have some impact on performance, you need to pay special attention to the following points if you use AndroidGodEye in a production environment:
Module Name | Desc | Can apply for release | Note |
---|---|---|---|
CPU | Cpu info of device and app | Yes | Reporting every period of time is meaningless for data statistics, but it can be used for troubleshooting of single user |
BATTERY | Battery info | Yes | - |
FPS | Fps info | Not recommend | Will be slight impact on the performance, Use SM module if you want to detect the jamming |
LEAK_CANARY | Detect memory leak | No | Can not be installed when release |
HEAP | Heap memory | Yes | Reporting every period of time is meaningless for data statistics, but it can be used for troubleshooting of single user |
PSS | Pss | Yes | Reporting every period of time is meaningless for data statistics, but it can be used for troubleshooting of single user |
RAM | Ram | Yes | Reporting every period of time is meaningless for data statistics, but it can be used for troubleshooting of single user |
NETWORK | Network info | Yes | - |
SM | Detect jamming | Yes | Pay attention to set the threshold to prevent too many reports from impacting performance |
STARTUP | Startup metric | Yes | - |
TRAFFIC | Traffic of device and app | Yes | - |
CRASH | Detect java、native crash and ANR | Yes | - |
THREAD | Thread dump of app | Yes | Reporting every period of time is meaningless for data statistics, but it can be used for troubleshooting of single user |
PAGELOAD | Page(Activity and Fragment) lifecycle and load time metric | Yes | - |
METHOD_CANARY | Methods time cost metric | No |
'cn.hikyson.methodcanary.plugin' config AndroidGodEye { enableMethodTracer false }
|
APP_SIZE | App size of apk code、storage and cache | Yes | - |
VIEW_CANARY | Detect complex layout hierarchy and overdraw | Not recommend | Will be slight impact on the performance |
IMAGE_CANARY | Detect unreasonable memory use of image | Yes | - |