Skip to content

Commit

Permalink
1 增加可配置dumpheap频率
Browse files Browse the repository at this point in the history
  • Loading branch information
look.lk committed Sep 23, 2020
1 parent d55df74 commit 18c3a73
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions config.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ package=com.taobao.taobao
frequency=5
#collect timeout ,int type ,unit:minute, for example:72 hours 4320
timeout=4320
#dumpheap frequency, int type,unit: minute
dumpheap_freq=60
#adb serialnum,adb devices result example WSKFSKBQLFA695D6
serialnum=SJE7N17817000652
serialnum=9e15838
#except log tag,tools will check in logcat,save exception log in exception.log,multi tags separate use ;
exceptionlog=fatal exception;has died
#monkey test,true will enable,other disable
Expand All @@ -19,4 +21,4 @@ save_path=
#device pull path,test end,tool pull path to PC,multi path separate use;
phone_log_path=/data/anr
#mailbox Reserved, no use
mailbox=390125133@qq.com
mailbox=390125133@qq.com
4 changes: 2 additions & 2 deletions mobileperf/android/meminfos.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,8 @@ def _collect_memory_thread(self, start_time):
writer_p.writerow(pss_detail_list)
# 写到pss_detail表格中

# 手机每5分钟 dumpheap一次
if (before - starttime_stamp)>300 or first_dump:
# 每隔dumpheap_freq分钟, dumpheap一次
if (before - starttime_stamp) > RuntimeData.config_dic["dumpheap_freq"] or first_dump:
# 先清理hprof文件
filelist = self.device.adb.list_dir(hprof_path)
if filelist:
Expand Down
3 changes: 3 additions & 0 deletions mobileperf/android/startup.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def parse_data_from_config(self):
config_dic = self.check_config_option(config_dic, paser, "Common", "package")
config_dic = self.check_config_option(config_dic, paser, "Common", "pid_change_focus_package")
config_dic = self.check_config_option(config_dic, paser, "Common","frequency")
config_dic = self.check_config_option(config_dic, paser, "Common", "dumpheap_freq")
config_dic = self.check_config_option(config_dic, paser, "Common", "timeout")
config_dic = self.check_config_option(config_dic, paser, "Common", "serialnum")
config_dic = self.check_config_option(config_dic, paser, "Common", "mailbox")
Expand All @@ -144,6 +145,8 @@ def check_config_option(self, config_dic, parse, section, option):
config_dic[option] = parse.get(section, option)
if option == 'frequency':
config_dic[option] = (int)(parse.get(section, option))
if option == 'dumpheap_freq':#dumpheap 的单位是分钟
config_dic[option] = (int)(parse.get(section, option))*60
if option == 'timeout':#timeout 的单位是分钟
config_dic[option] = (int)(parse.get(section, option))*60
if option in ["exceptionlog" ,"phone_log_path","space_size_check_path","package","pid_change_focus_package",
Expand Down

0 comments on commit 18c3a73

Please sign in to comment.