Skip to content

Commit

Permalink
v2.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
rafa0128 committed Mar 24, 2023
1 parent 3418f85 commit 5ad6bcd
Show file tree
Hide file tree
Showing 15 changed files with 520 additions and 481 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -131,3 +131,6 @@ dmypy.json

# Pyre type checker
.pyre/

# report
report/
19 changes: 10 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ We are committed to solving inefficient, cumbersome test execution, and our goal

## Installation
```
1.Python:3.6+
1.Python:3.10+ (python3.6+ lower v2.5.3)
2.pip install -U solox
3.pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox (Recommend)
Expand All @@ -42,21 +42,24 @@ python -m solox
### customize

```shell
python -m solox --host={ip} --port=50003
python -m solox --host={ip} --port={port}
```

## Collect in python
```python
from solox.public.apm import APM
# solox version >= 2.1.2

apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview='true') # surfaceview: false = gpxinfo
apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview=True)
# apm = APM(pkgName='com.bilibili.app.in', platform='iOS') only supports one device
# surfaceview: false = gfxinfo (Developer - GPU rendering mode - adb shell dumpsys gfxinfo)

cpu = apm.collectCpu() # %
memory = apm.collectMemory() # MB
flow = apm.collectFlow() # KB
fps = apm.collectFps() # HZ
battery = apm.collectBattery() # level:% temperature:°C
battery = apm.collectBattery() # level:% temperature:°C current:mA voltage:mV power:w
gpu = apm.collectGpu() # % only supports ios
```

## Collect in API
Expand All @@ -71,9 +74,10 @@ Windows: start /min python3 -m solox &

### Request apm data from api
```
http://{ip}:50003/apm/collect?platform=Android&deviceid=ca6bd5a5&pkgname=com.bilibili.app.in&apm_type=cpu
- Android: http://{ip}:{port}/apm/collect?platform=Android&deviceid=ca6bd5a5&pkgname=com.bilibili.app.in&target=cpu
- iOS: http://{ip}:{port}/apm/collect?platform=iOS&pkgname=com.bilibili.app.in&target=cpu
apm_type in ['cpu','memory','network','fps','battery']
target in ['cpu','memory','network','fps','battery']
```

## PK Model
Expand All @@ -95,6 +99,3 @@ apm_type in ['cpu','memory','network','fps','battery']

- https://github.com/alibaba/taobao-iphone-device

## Communicate
- Email: laoqi1988_f1@126.com

18 changes: 9 additions & 9 deletions README.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ SoloX - Android/iOS性能数据实时采集工具。

## 安装
```
1.Python:3.6+
1.Python:3.6+ (python3.6+ 小于v2.5.3)
2.pip install -U solox
3.pip install -i https://mirrors.ustc.edu.cn/pypi/web/simple -U solox (在国内推荐使用镜像下载)
Expand All @@ -42,21 +42,23 @@ python -m solox
### 自定义

```shell
python -m solox --host={ip} --port=50003
python -m solox --host={ip} --port={port}
```

## 使用python收集
```python
from solox.public.apm import APM
# solox version >= 2.1.2

apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview='true') # surfaceview: false = gpxinfo
apm = APM(pkgName='com.bilibili.app.in',deviceId='ca6bd5a5',platform='Android', surfaceview=True)
# apm = APM(pkgName='com.bilibili.app.in', platform='iOS') only supports one device
# surfaceview: false = gfxinfo (手机开发者-GPU呈现模式- adb shell dumpsys gfxinfo)
cpu = apm.collectCpu() # %
memory = apm.collectMemory() # MB
flow = apm.collectFlow() # KB
fps = apm.collectFps() # HZ
battery = apm.collectBattery() # level:% temperature:°C
battery = apm.collectBattery() # level:% temperature:°C current:mA voltage:mV power:w
gpu = apm.collectGpu() # % only supports ios
```

## 使用api收集
Expand All @@ -71,9 +73,10 @@ Windows: start /min python3 -m solox &

### 2.通过api请求性能数据
```
http://{ip}:50003/apm/collect?platform=Android&deviceid=ca6bd5a5&pkgname=com.bilibili.app.in&apm_type=cpu
- Android: http://{ip}:{port}/apm/collect?platform=Android&deviceid=ca6bd5a5&pkgname=com.bilibili.app.in&target=cpu
- iOS: http://{ip}:{port}/apm/collect?platform=iOS&pkgname=com.bilibili.app.in&target=cpu
apm_type in ['cpu','memory','network','fps','battery']
target in ['cpu','memory','network','fps','battery']
```

## 对比模式
Expand All @@ -95,7 +98,4 @@ apm_type in ['cpu','memory','network','fps','battery']

- https://github.com/alibaba/taobao-iphone-device

## 交流
- Email: laoqi1988_f1@126.com


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.5.3'
__version__ = '2.5.4'
1 change: 0 additions & 1 deletion solox/debug.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ def getServerStatus(host: str, port: int):
"""
try:
r = requests.get(f'http://{host}:{port}', timeout=2.0)
# True和False对应的数值是1和0
flag = (True, False)[r.status_code == 200]
return flag
except requests.exceptions.ConnectionError:
Expand Down
Loading

0 comments on commit 5ad6bcd

Please sign in to comment.