Skip to content

Commit

Permalink
update FAQ
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Jul 27, 2023
1 parent d836eb8 commit 2c0fc80
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,3 +100,9 @@
* 界面收集:在首页打开“Record Screen”开关,点击Start开始收集数据并同时录制视频,结束后Report管理页会显示播放按钮。
* Python API收集:record=True。
* Mac电脑录制视频,请检查Scrcpy是否安装成功,可以自行安装:brew install scrcpy。

## 1️⃣9️⃣ Android哪些指标以来app的进程需要存活?

* Cpu、Memory、Network、FPS
* 界面如果不选择进程就点击Start收集,那么默认使用的是这个包名的主进程。
* 界面选择了app的某个进程收集,如果收集过程中将app杀掉,然后再恢复后自动使用的是主进程,有可能和你界面选择的进程不一致。
6 changes: 3 additions & 3 deletions solox/public/apm.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def getCpuCores(self):

def getSysCpuStat(self):
"""get the total cpu usage at a certain time"""
cmd = f'cat /proc/stat |{d.filterType()} ^cpu'
cmd = 'cat /proc/stat |{} ^cpu'.format(d.filterType())
result = adb.shell(cmd=cmd, deviceId=self.deviceId)
r = re.compile(r'(?<!cpu)\d+')
toks = r.findall(result)
Expand Down Expand Up @@ -125,7 +125,7 @@ def __init__(self, pkgName, deviceId, platform=Platform.Android, pid=None):
def getAndroidMem(self):
"""Get the Android memory ,unit:MB"""
try:
cmd = f'dumpsys meminfo {self.pid}'
cmd = 'dumpsys meminfo {}'.format(self.pid)
output = adb.shell(cmd=cmd, deviceId=self.deviceId)
m_total = re.search(r'TOTAL\s*(\d+)', output)
m_native = re.search(r'Native Heap\s*(\d+)', output)
Expand Down Expand Up @@ -224,7 +224,7 @@ def getAndroidNet(self, wifi=True):
"""Get Android send/recv data, unit:KB wlan0/rmnet0"""
try:
net = 'wlan0' if wifi else 'rmnet0'
cmd = f'cat /proc/{self.pid}/net/dev |{d.filterType()} {net}'
cmd = 'cat /proc/{}/net/dev |{} {}'.format(self.pid, d.filterType(), net)
output_pre = adb.shell(cmd=cmd, deviceId=self.deviceId)
m_pre = re.search(r'{}:\s*(\d+)\s*\d+\s*\d+\s*\d+\s*\d+\s*\d+\s*\d+\s*\d+\s*(\d+)'.format(net), output_pre)
sendNum_pre = round(float(float(m_pre.group(2)) / 1024), 2)
Expand Down
6 changes: 3 additions & 3 deletions solox/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,8 +129,8 @@ def main(host=hostIP(), port=50003):
pool.apply_async(openUrl, (host, port))
pool.close()
pool.join()
except Exception as e:
logger.exception(e)
except KeyboardInterrupt:
logger.info('stop solox success')
sys.exit()
sys.exit()
except Exception as e:
logger.exception(e)

0 comments on commit 2c0fc80

Please sign in to comment.