Skip to content

Commit

Permalink
v2.8.2
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Nov 24, 2023
1 parent ad48bc0 commit d61bb5e
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ gpu = apm.collectGpu() # % only supports ios
if __name__ == '__main__':
apm = AppPerformanceMonitor(pkgName='com.bilibili.app.in',platform='Android', deviceId='ca6bd5a5', surfaceview=True, noLog=False, pid=None, record=False)
# apm = AppPerformanceMonitor(pkgName='com.bilibili.app.in', platform='iOS', deviceId='xxxx', noLog=False, record=False)
# duration : second record: record android screen
#record: record android screen
apm.collectAll() # will generate HTML report

# in other python file
Expand Down
2 changes: 1 addition & 1 deletion README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ gpu = apm.collectGpu() # % 只支持ios
if __name__ == '__main__':
apm = AppPerformanceMonitor(pkgName='com.bilibili.app.in',platform='Android', deviceId='ca6bd5a5', surfaceview=True, noLog=False, pid=None, record=False)
# apm = AppPerformanceMonitor(pkgName='com.bilibili.app.in', platform='iOS', deviceId='xxxx', noLog=False, record=False)
# duration : 持续执行时间(秒) record: 是否录制
# record: 是否录制
apm.collectAll() # will generate HTML report

# 在另外的python脚本中终止solox服务可以停止测试
Expand Down
2 changes: 1 addition & 1 deletion solox/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

from __future__ import absolute_import

__version__ = '2.8.1'
__version__ = '2.8.2'
14 changes: 4 additions & 10 deletions solox/public/apm.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,9 @@ def stop(cls):
config_json = json.loads(open(file=cls.CONIFG_PATH, mode='r').read())
config_json['run_switch'] = 'off'
with open(cls.CONIFG_PATH, "w") as file:
json.dump(config_json, file)
json.dump(config_json, file)
logger.info('stop solox success')
return True

class AppPerformanceMonitor(initPerformanceService):
"""for python api"""
Expand All @@ -462,8 +464,6 @@ def collectCpu(self):
appCpuRate, systemCpuRate = _cpu.getCpuRate(noLog=self.noLog)
result = {'appCpuRate': appCpuRate, 'systemCpuRate': systemCpuRate}
logger.info(f'cpu: {result}')
if time.time() > self.end_time:
break
return result

def collectMemory(self):
Expand Down Expand Up @@ -598,10 +598,4 @@ def collectAll(self):
Scrcpy.stop_record()
logger.exception(e)
finally:
logger.info('End of testing')


if __name__ == '__main__':
apm = AppPerformanceMonitor(pkgName='com.tencent.qqmusic',platform='Android', deviceId='BRNUT21B15044184',
surfaceview=True, noLog=False, pid=None, record=False)
apm.collectAll()
logger.info('End of testing')

0 comments on commit d61bb5e

Please sign in to comment.