perfdog-service-cli 1.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. perfdog_service_cli-1.0.1/PKG-INFO +104 -0
  2. perfdog_service_cli-1.0.1/README.md +90 -0
  3. perfdog_service_cli-1.0.1/pyproject.toml +57 -0
  4. perfdog_service_cli-1.0.1/setup.cfg +4 -0
  5. perfdog_service_cli-1.0.1/src/perfdog_service_cli/__init__.py +8 -0
  6. perfdog_service_cli-1.0.1/src/perfdog_service_cli/__main__.py +6 -0
  7. perfdog_service_cli-1.0.1/src/perfdog_service_cli/cli/__init__.py +2 -0
  8. perfdog_service_cli-1.0.1/src/perfdog_service_cli/cli/__main__.py +6 -0
  9. perfdog_service_cli-1.0.1/src/perfdog_service_cli/cli/main.py +1300 -0
  10. perfdog_service_cli-1.0.1/src/perfdog_service_cli/cli/output.py +111 -0
  11. perfdog_service_cli-1.0.1/src/perfdog_service_cli/common/__init__.py +2 -0
  12. perfdog_service_cli-1.0.1/src/perfdog_service_cli/common/config.py +48 -0
  13. perfdog_service_cli-1.0.1/src/perfdog_service_cli/common/log.py +82 -0
  14. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/__init__.py +5 -0
  15. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/perf_data_printer.py +682 -0
  16. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/perfdog_pb2.py +2666 -0
  17. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/perfdog_pb2_grpc.py +1990 -0
  18. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/service_client.py +1145 -0
  19. perfdog_service_cli-1.0.1/src/perfdog_service_cli/service/service_ops.py +1819 -0
  20. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/PKG-INFO +104 -0
  21. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/SOURCES.txt +27 -0
  22. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/dependency_links.txt +1 -0
  23. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/entry_points.txt +2 -0
  24. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/requires.txt +8 -0
  25. perfdog_service_cli-1.0.1/src/perfdog_service_cli.egg-info/top_level.txt +1 -0
  26. perfdog_service_cli-1.0.1/tests/test_cli.py +472 -0
  27. perfdog_service_cli-1.0.1/tests/test_e2e.py +653 -0
  28. perfdog_service_cli-1.0.1/tests/test_integration.py +274 -0
  29. perfdog_service_cli-1.0.1/tests/test_service_ops.py +501 -0
@@ -0,0 +1,104 @@
1
+ Metadata-Version: 2.4
2
+ Name: perfdog-service-cli
3
+ Version: 1.0.1
4
+ Summary: PerfDog Service CLI - 命令行性能测试工具(供 AI/自动化脚本使用)
5
+ Requires-Python: >=3.10
6
+ Description-Content-Type: text/markdown
7
+ Requires-Dist: click>=8.1.0
8
+ Requires-Dist: grpcio>=1.60.0
9
+ Requires-Dist: protobuf>=4.25.0
10
+ Requires-Dist: pyyaml>=6.0.2
11
+ Provides-Extra: dev
12
+ Requires-Dist: pytest>=7.0; extra == "dev"
13
+ Requires-Dist: pytest-cov>=4.0; extra == "dev"
14
+
15
+ # perfdog-service-cli
16
+
17
+ PerfDog Service 命令行性能测试工具 — 供 AI Agent / 自动化脚本使用。
18
+
19
+ ## 安装
20
+
21
+ ```bash
22
+ pip install perfdog-service-cli --extra-index-url https://<username>:<token>@mirrors.tencent.com/repository/pypi/tencent_pypi/simple
23
+ ```
24
+
25
+ ## 快速开始
26
+
27
+ ```bash
28
+ # 连接 PerfDog Service
29
+ perfdog-service connect --token YOUR_TOKEN
30
+
31
+ # 查看设备列表
32
+ perfdog-service devices
33
+
34
+ # 一键测试应用
35
+ perfdog-service test-app -d DEVICE_ID -p com.example.app --duration 60
36
+
37
+ # 手动控制测试流程(供 AI 编排)
38
+ perfdog-service start -d DEVICE_ID --package com.example.app
39
+ perfdog-service label -d DEVICE_ID -n "场景1"
40
+ perfdog-service stop -d DEVICE_ID
41
+ perfdog-service save -d DEVICE_ID --case-name "v1.0测试"
42
+ ```
43
+
44
+ ## 命令列表
45
+
46
+ | 类别 | 命令 | 说明 |
47
+ |------|------|------|
48
+ | 连接 | `connect` | 连接 PerfDog Service |
49
+ | 设备 | `devices` | 获取设备列表 |
50
+ | | `init-device` | 初始化设备 |
51
+ | | `status` | 获取设备状态 |
52
+ | | `device-info` | 获取设备详细信息 |
53
+ | | `cpu-info` | 获取 CPU 信息 |
54
+ | 应用 | `apps` | 获取应用列表 |
55
+ | | `processes` | 获取系统进程列表 |
56
+ | 一键测试 | `test-app` | 一键测试应用 |
57
+ | | `test-windows` | 一键测试 Windows 进程 |
58
+ | | `test-console` | 一键测试游戏主机 |
59
+ | | `test-network` | 弱网测试 |
60
+ | 手动控制 | `start` | 开始测试 |
61
+ | | `stop` | 停止测试 |
62
+ | | `save` | 保存数据 |
63
+ | | `label` | 添加标签 |
64
+ | | `note` | 添加注释 |
65
+ | | `update-label` | 修改标签 |
66
+ | | `remove-note` | 删除注释 |
67
+ | 配置 | `preferences` | 设置偏好(APK 安装等) |
68
+ | | `available-types` | 查看支持的数据类型 |
69
+ | | `enabled-types` | 查看已启用的类型 |
70
+ | | `set-screenshot-interval` | 设置截图间隔 |
71
+ | | `set-memory-freq` | 设置内存采样频率 |
72
+ | 弱网 | `network-templates` | 查看网络模板 |
73
+ | | `change-network-template` | 切换网络模板 |
74
+ | | `submit-network-template` | 创建网络模板 |
75
+ | | `delete-network-template` | 删除网络模板 |
76
+ | 高级 | `add-console` | 添加主机设备 |
77
+ | | `refresh-remote` | 刷新远程设备 |
78
+ | | `check-occupied` | 检查设备占用 |
79
+ | | `render-resolution` | 获取渲染分辨率 |
80
+ | | `unreal-report` | Unreal 内存报告 |
81
+ | | `launch-remote-collector` | 启动远程收集器 |
82
+ | | `set-upload-server` | 设置数据上传服务器 |
83
+ | | `clear-upload-server` | 清除数据上传服务器 |
84
+ | 管理 | `create-task` | 创建任务 |
85
+ | | `archive-case` | 归档用例 |
86
+ | | `share-case` | 分享用例 |
87
+ | | `kill` | 关闭 Service |
88
+
89
+ ## 架构
90
+
91
+ ```
92
+ perfdog_service_cli/
93
+ ├── cli/ # Click 命令定义
94
+ │ ├── main.py # 36 个原子命令
95
+ │ └── output.py # 终端格式化
96
+ ├── service/ # gRPC 通信层
97
+ │ ├── service_client.py # gRPC 客户端
98
+ │ ├── service_ops.py # 原子操作(序列化边界)
99
+ │ ├── perfdog_pb2.py # protobuf
100
+ │ └── perfdog_pb2_grpc.py # gRPC stub
101
+ └── common/ # 配置 + 日志
102
+ ├── config.py
103
+ └── log.py
104
+ ```
@@ -0,0 +1,90 @@
1
+ # perfdog-service-cli
2
+
3
+ PerfDog Service 命令行性能测试工具 — 供 AI Agent / 自动化脚本使用。
4
+
5
+ ## 安装
6
+
7
+ ```bash
8
+ pip install perfdog-service-cli --extra-index-url https://<username>:<token>@mirrors.tencent.com/repository/pypi/tencent_pypi/simple
9
+ ```
10
+
11
+ ## 快速开始
12
+
13
+ ```bash
14
+ # 连接 PerfDog Service
15
+ perfdog-service connect --token YOUR_TOKEN
16
+
17
+ # 查看设备列表
18
+ perfdog-service devices
19
+
20
+ # 一键测试应用
21
+ perfdog-service test-app -d DEVICE_ID -p com.example.app --duration 60
22
+
23
+ # 手动控制测试流程(供 AI 编排)
24
+ perfdog-service start -d DEVICE_ID --package com.example.app
25
+ perfdog-service label -d DEVICE_ID -n "场景1"
26
+ perfdog-service stop -d DEVICE_ID
27
+ perfdog-service save -d DEVICE_ID --case-name "v1.0测试"
28
+ ```
29
+
30
+ ## 命令列表
31
+
32
+ | 类别 | 命令 | 说明 |
33
+ |------|------|------|
34
+ | 连接 | `connect` | 连接 PerfDog Service |
35
+ | 设备 | `devices` | 获取设备列表 |
36
+ | | `init-device` | 初始化设备 |
37
+ | | `status` | 获取设备状态 |
38
+ | | `device-info` | 获取设备详细信息 |
39
+ | | `cpu-info` | 获取 CPU 信息 |
40
+ | 应用 | `apps` | 获取应用列表 |
41
+ | | `processes` | 获取系统进程列表 |
42
+ | 一键测试 | `test-app` | 一键测试应用 |
43
+ | | `test-windows` | 一键测试 Windows 进程 |
44
+ | | `test-console` | 一键测试游戏主机 |
45
+ | | `test-network` | 弱网测试 |
46
+ | 手动控制 | `start` | 开始测试 |
47
+ | | `stop` | 停止测试 |
48
+ | | `save` | 保存数据 |
49
+ | | `label` | 添加标签 |
50
+ | | `note` | 添加注释 |
51
+ | | `update-label` | 修改标签 |
52
+ | | `remove-note` | 删除注释 |
53
+ | 配置 | `preferences` | 设置偏好(APK 安装等) |
54
+ | | `available-types` | 查看支持的数据类型 |
55
+ | | `enabled-types` | 查看已启用的类型 |
56
+ | | `set-screenshot-interval` | 设置截图间隔 |
57
+ | | `set-memory-freq` | 设置内存采样频率 |
58
+ | 弱网 | `network-templates` | 查看网络模板 |
59
+ | | `change-network-template` | 切换网络模板 |
60
+ | | `submit-network-template` | 创建网络模板 |
61
+ | | `delete-network-template` | 删除网络模板 |
62
+ | 高级 | `add-console` | 添加主机设备 |
63
+ | | `refresh-remote` | 刷新远程设备 |
64
+ | | `check-occupied` | 检查设备占用 |
65
+ | | `render-resolution` | 获取渲染分辨率 |
66
+ | | `unreal-report` | Unreal 内存报告 |
67
+ | | `launch-remote-collector` | 启动远程收集器 |
68
+ | | `set-upload-server` | 设置数据上传服务器 |
69
+ | | `clear-upload-server` | 清除数据上传服务器 |
70
+ | 管理 | `create-task` | 创建任务 |
71
+ | | `archive-case` | 归档用例 |
72
+ | | `share-case` | 分享用例 |
73
+ | | `kill` | 关闭 Service |
74
+
75
+ ## 架构
76
+
77
+ ```
78
+ perfdog_service_cli/
79
+ ├── cli/ # Click 命令定义
80
+ │ ├── main.py # 36 个原子命令
81
+ │ └── output.py # 终端格式化
82
+ ├── service/ # gRPC 通信层
83
+ │ ├── service_client.py # gRPC 客户端
84
+ │ ├── service_ops.py # 原子操作(序列化边界)
85
+ │ ├── perfdog_pb2.py # protobuf
86
+ │ └── perfdog_pb2_grpc.py # gRPC stub
87
+ └── common/ # 配置 + 日志
88
+ ├── config.py
89
+ └── log.py
90
+ ```
@@ -0,0 +1,57 @@
1
+ [project]
2
+ name = "perfdog-service-cli"
3
+ version = "1.0.1"
4
+ description = "PerfDog Service CLI - 命令行性能测试工具(供 AI/自动化脚本使用)"
5
+ readme = "README.md"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "click>=8.1.0",
9
+ "grpcio>=1.60.0",
10
+ "protobuf>=4.25.0",
11
+ "pyyaml>=6.0.2",
12
+ ]
13
+
14
+ [project.optional-dependencies]
15
+ dev = [
16
+ "pytest>=7.0",
17
+ "pytest-cov>=4.0",
18
+ ]
19
+
20
+ [build-system]
21
+ requires = ["setuptools>=42", "wheel"]
22
+ build-backend = "setuptools.build_meta"
23
+
24
+ [tool.setuptools.packages.find]
25
+ where = ["src"]
26
+
27
+ [project.scripts]
28
+ perfdog-service = "perfdog_service_cli.cli.main:main"
29
+
30
+ [[tool.uv.index]]
31
+ url = "https://mirrors.cloud.tencent.com/pypi/simple/"
32
+ default = true
33
+
34
+ [tool.pytest.ini_options]
35
+ testpaths = ["tests"]
36
+ python_files = ["test_*.py"]
37
+ python_classes = ["Test*"]
38
+ python_functions = ["test_*"]
39
+ addopts = "-v --tb=short -m 'not integration and not e2e'"
40
+ markers = [
41
+ "integration: 集成测试,需要本机运行 PerfDog Service(PERFDOG_SERVICE_TOKEN)",
42
+ "e2e: 端到端测试,需要真实设备(PERFDOG_E2E_DEVICE_ID + PERFDOG_E2E_PACKAGE)",
43
+ ]
44
+
45
+ [tool.ruff]
46
+ line-length = 120
47
+ target-version = "py310"
48
+
49
+ [tool.ruff.lint]
50
+ select = ["E", "F", "W", "I"]
51
+
52
+ [tool.ruff.lint.isort]
53
+ known-first-party = ["perfdog_service_cli"]
54
+
55
+ [tool.ruff.format]
56
+ indent-style = "space"
57
+ line-ending = "lf"
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,8 @@
1
+ # coding: utf-8
2
+ """PerfDog Service CLI - 命令行性能测试工具
3
+
4
+ 通过 PerfDog Service gRPC 接口进行设备管理、性能测试、数据采集。
5
+ 供 AI Agent / 自动化脚本组合原子命令使用。
6
+ """
7
+
8
+ __version__ = "0.1.0"
@@ -0,0 +1,6 @@
1
+ # coding: utf-8
2
+ """支持 python -m perfdog_service_cli 运行"""
3
+ from perfdog_service_cli.cli.main import main
4
+
5
+ if __name__ == "__main__":
6
+ main()
@@ -0,0 +1,2 @@
1
+ # coding: utf-8
2
+ """PerfDog Service CLI - 命令行工具"""
@@ -0,0 +1,6 @@
1
+ # coding: utf-8
2
+ """支持 python -m perfdog_service_cli 运行"""
3
+ from perfdog_service_cli.cli.main import main
4
+
5
+ if __name__ == "__main__":
6
+ main()