Skip to content

0x02b Apply AndroidGodEye for Release_en

AndroidKy edited this page Mar 31, 2020 · 9 revisions

Apply AndroidGodEye For Release

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 config

There are 2 Steps:

Step0 Close notification

buildTypes {
  release {
      // close notification
      resValue("bool", "android_god_eye_need_notification", "false") 
  }
}

Step1 Change module config

Because some modules have some impact on performance, you should change module config in production environment:

buildTypes {
  release {
      // specify different module config
      resValue("string", "android_god_eye_install_assets_path", "android-godeye-config/release_install.config") 
  }
}

Module config details

Removed module declaraction in xml file if you don't need it

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 -

Done!

Clone this wiki locally