Skip to content

0x03z Other modules_en

hui.zhao edited this page Nov 24, 2019 · 2 revisions

Other Modules

Other modules are as following:

public static final String CPU = "CPU";
public static final String BATTERY = "BATTERY";
public static final String FPS = "FPS";
public static final String HEAP = "HEAP";
public static final String PSS = "PSS";
public static final String RAM = "RAM";
public static final String TRAFFIC = "TRAFFIC";
public static final String THREAD = "THREAD";

Install

All of these modules install as following

GodEye.instance().install(GodEyeConfig.defaultConfigBuilder().withXXConfig(new GodEyeConfig.XXConfig()).build());

or

<cpu intervalMillis="2000" sampleMillis="2000"/>
<battery />
<fps intervalMillis="2000"/>
<heap intervalMillis="2000"/>
<pss intervalMillis="2000"/>
<ram intervalMillis="2000"/>
<traffic intervalMillis="2000" sampleMillis="1000"/>
<thread intervalMillis="3000"
        threadFilter="cn.hikyson.godeye.core.internal.modules.thread.SimpleThreadFilter"/>

threadFilter in thread module is used to filter threads you don't want to care about. SimpleThreadFilter will be provided by default. You can customize it by implement the interface ThreadFilter

Production and consumption of data

Use the following methods to observe the output:

try {
            GodEye.instance().observeModule(GodEye.ModuleName.XX, new Consumer<XX>() {
                @Override
                public void accept(XX info) throws Exception {
                }
            });
        } catch (UninstallException e) {
            e.printStackTrace();
        }

All of these modules will callback every intervalMillis except battery which callback when battery status changed.

Clone this wiki locally