alicloud-observability-pts
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCategory: service
类别:服务
Alibaba Cloud Performance Testing Service (PTS)
阿里云性能测试服务(PTS)
Purpose
用途
Use Alibaba Cloud PTS OpenAPI to support:
- test scene inventory and inspection
- pressure test planning and lifecycle automation
- report and metrics retrieval for verification and troubleshooting
使用阿里云PTS OpenAPI支持:
- 测试场景盘点与检查
- 压力测试规划与生命周期自动化
- 报告与指标检索,用于验证与故障排查
Prerequisites
前置条件
- Configure least-privilege Alibaba Cloud credentials.
- Install Python SDKs (virtual environment recommended):
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -U alibabacloud_pts20201020 alibabacloud_tea_openapi- Prefer environment variables:
ALICLOUD_ACCESS_KEY_IDALICLOUD_ACCESS_KEY_SECRET- optional
ALICLOUD_REGION_ID
- Before mutating operations, run read-only API discovery and current-state checks.
- 配置最小权限的阿里云凭证。
- 安装Python SDK(推荐使用虚拟环境):
bash
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -U alibabacloud_pts20201020 alibabacloud_tea_openapi- 优先使用环境变量:
ALICLOUD_ACCESS_KEY_IDALICLOUD_ACCESS_KEY_SECRET- 可选
ALICLOUD_REGION_ID
- 在执行变更操作前,先运行只读API发现和当前状态检查。
AccessKey Priority
AccessKey 优先级
- Environment variables: /
ALICLOUD_ACCESS_KEY_ID/ALICLOUD_ACCESS_KEY_SECRETALICLOUD_REGION_ID - Shared credentials file:
~/.alibabacloud/credentials
If region/environment is unclear, confirm with user before mutating operations.
- 环境变量:/
ALICLOUD_ACCESS_KEY_ID/ALICLOUD_ACCESS_KEY_SECRETALICLOUD_REGION_ID - 共享凭证文件:
~/.alibabacloud/credentials
如果区域/环境不明确,在执行变更操作前请与用户确认。
Workflow
工作流程
- Identify target region, test scene identifiers, and operation scope.
- Run API discovery to confirm API names and required parameters.
- Execute read-only APIs first (/
List*/Get*).Describe* - Execute mutating operations only after confirming rollback and change window.
- Save outputs and evidence to .
output/alicloud-observability-pts/
- 确定目标区域、测试场景标识符和操作范围。
- 运行API发现以确认API名称和所需参数。
- 先执行只读API(/
List*/Get*)。Describe* - 仅在确认回滚方案和变更窗口后,再执行变更操作。
- 将输出和证据保存至。
output/alicloud-observability-pts/
API Discovery
API 发现
- Product code:
PTS - Default API version:
2020-10-20 - Metadata source:
https://api.aliyun.com/meta/v1/products/PTS/versions/2020-10-20/api-docs.json
- 产品代码:
PTS - 默认API版本:
2020-10-20 - 元数据来源:
https://api.aliyun.com/meta/v1/products/PTS/versions/2020-10-20/api-docs.json
Minimal Executable Quickstart
最简可执行快速入门
bash
python skills/observability/pts/alicloud-observability-pts/scripts/list_openapi_meta_apis.pyOptional arguments:
bash
python skills/observability/pts/alicloud-observability-pts/scripts/list_openapi_meta_apis.py \
--product-code PTS \
--version 2020-10-20 \
--output-dir output/alicloud-observability-ptsList scenes (read-only):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/list_pts_scenes.py \
--region cn-hangzhou \
--page-number 1 \
--page-size 10 \
--output output/alicloud-observability-pts/scenes.txtStart one scene (mutating):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/start_pts_scene.py \
--region cn-hangzhou \
--scene-id <scene-id> \
--wait \
--output output/alicloud-observability-pts/start-result.jsonStop one scene (mutating):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/stop_pts_scene.py \
--region cn-hangzhou \
--scene-id <scene-id> \
--wait \
--output output/alicloud-observability-pts/stop-result.jsonbash
python skills/observability/pts/alicloud-observability-pts/scripts/list_openapi_meta_apis.py可选参数:
bash
python skills/observability/pts/alicloud-observability-pts/scripts/list_openapi_meta_apis.py \
--product-code PTS \
--version 2020-10-20 \
--output-dir output/alicloud-observability-pts列出场景(只读):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/list_pts_scenes.py \
--region cn-hangzhou \
--page-number 1 \
--page-size 10 \
--output output/alicloud-observability-pts/scenes.txt启动单个场景(变更操作):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/start_pts_scene.py \
--region cn-hangzhou \
--scene-id <scene-id> \
--wait \
--output output/alicloud-observability-pts/start-result.json停止单个场景(变更操作):
bash
python skills/observability/pts/alicloud-observability-pts/scripts/stop_pts_scene.py \
--region cn-hangzhou \
--scene-id <scene-id> \
--wait \
--output output/alicloud-observability-pts/stop-result.jsonCommon Operation Map
常用操作映射
- Scene inventory: ,
ListPtsScene,GetPtsScene,ListOpenJMeterScenesGetOpenJMeterScene - Scene lifecycle: ,
CreatePtsScene,SavePtsScene,ModifyPtsScene,DeletePtsSceneDeletePtsScenes - Test execution control: ,
StartPtsScene,StopPtsScene,StartTestingJMeterSceneStopTestingJMeterScene - Debug control: ,
StartDebugPtsScene,StopDebugPtsScene,StartDebuggingJMeterSceneStopDebuggingJMeterScene - Reports/metrics: ,
ListPtsReports,GetPtsReportDetails,GetPtsSceneRunningDataGetPtsSceneRunningStatus
See for grouped API lists.
references/api_quick_map.md- 场景盘点:,
ListPtsScene,GetPtsScene,ListOpenJMeterScenesGetOpenJMeterScene - 场景生命周期:,
CreatePtsScene,SavePtsScene,ModifyPtsScene,DeletePtsSceneDeletePtsScenes - 测试执行控制:,
StartPtsScene,StopPtsScene,StartTestingJMeterSceneStopTestingJMeterScene - 调试控制:,
StartDebugPtsScene,StopDebugPtsScene,StartDebuggingJMeterSceneStopDebuggingJMeterScene - 报告/指标:,
ListPtsReports,GetPtsReportDetails,GetPtsSceneRunningDataGetPtsSceneRunningStatus
分组API列表请查看。
references/api_quick_map.mdScript Catalog
脚本目录
- : fetch metadata and generate API inventory files.
scripts/list_openapi_meta_apis.py - : list PTS scenes with pagination.
scripts/list_pts_scenes.py - : start a scene and optionally poll running status.
scripts/start_pts_scene.py - : stop a scene and optionally poll until non-running.
scripts/stop_pts_scene.py
- :获取元数据并生成API清单文件。
scripts/list_openapi_meta_apis.py - :分页列出PTS场景。
scripts/list_pts_scenes.py - :启动场景并可选轮询运行状态。
scripts/start_pts_scene.py - :停止场景并可选轮询直至非运行状态。
scripts/stop_pts_scene.py
Output Policy
输出策略
Write generated files and execution evidence to:
output/alicloud-observability-pts/将生成的文件和执行证据写入:
output/alicloud-observability-pts/Validation
验证
bash
mkdir -p output/alicloud-observability-pts
for f in skills/observability/pts/alicloud-observability-pts/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/alicloud-observability-pts/validate.txtPass criteria: command exits 0 and is generated.
output/alicloud-observability-pts/validate.txtbash
mkdir -p output/alicloud-observability-pts
for f in skills/observability/pts/alicloud-observability-pts/scripts/*.py; do
python3 -m py_compile "$f"
done
echo "py_compile_ok" > output/alicloud-observability-pts/validate.txt通过标准:命令执行退出码为0,且生成文件。
output/alicloud-observability-pts/validate.txtOutput And Evidence
输出与证据
- Save artifacts, command outputs, and API response summaries under .
output/alicloud-observability-pts/ - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
- 将工件、命令输出和API响应摘要保存至下。
output/alicloud-observability-pts/ - 在证据文件中包含关键参数(区域/资源ID/时间范围)以确保可复现性。
References
参考资料
- Source list:
references/sources.md - API quick map:
references/api_quick_map.md - request/response templates:
references/templates.md
- 来源列表:
references/sources.md - API快速映射:
references/api_quick_map.md - 请求/响应模板:
references/templates.md