alibabacloud-pts-ops
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseAlibaba Cloud PTS Stress Testing Scenario Management
阿里云PTS压测场景管理
This skill enables you to create and manage stress testing scenarios using Alibaba Cloud PTS (Performance Testing Service). It supports both PTS native HTTP/HTTPS stress testing and JMeter-based stress testing.
本技能支持您使用阿里云PTS(性能测试服务)创建和管理压测场景,同时支持PTS原生HTTP/HTTPS压测和基于JMeter的压测。
Scenario Description
场景说明
PTS (Performance Testing Service) is Alibaba Cloud's fully managed performance testing platform that helps you validate the performance, capacity, and stability of your applications. This skill covers:
- PTS Native Stress Testing - Create HTTP/HTTPS stress testing scenarios with configurable APIs, serial links, and load models
- JMeter Stress Testing - Upload and run JMeter scripts with distributed load generation
PTS(性能测试服务)是阿里云的全托管性能测试平台,可帮助您验证应用的性能、容量和稳定性。本技能覆盖:
- PTS原生压测 - 创建HTTP/HTTPS压测场景,支持可配置的API、串行链路和负载模型
- JMeter压测 - 上传并运行JMeter脚本,支持分布式负载生成
Architecture
架构
User → Aliyun CLI → PTS Service → Target Application
↓
Stress Testing ReportUser → Aliyun CLI → PTS Service → Target Application
↓
Stress Testing ReportPre-check
预检查
Pre-check: Aliyun CLI >= 3.3.1 required Runto verify >= 3.3.1. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] runaliyun versionto enable automatic plugin installation.aliyun configure set --auto-plugin-install true
bash
undefined预检查:要求Aliyun CLI版本 >= 3.3.1 运行确认版本不低于3.3.1。如果未安装或版本过低,请参考 references/cli-installation-guide.md 完成安装。 之后**[必须]** 运行aliyun version开启自动插件安装功能。aliyun configure set --auto-plugin-install true
bash
undefinedVerify CLI version
验证CLI版本
aliyun version
aliyun version
Enable auto plugin installation
开启自动插件安装
aliyun configure set --auto-plugin-install true
undefinedaliyun configure set --auto-plugin-install true
undefinedTimeout Settings
超时设置
All CLI commands should include timeout parameters to avoid hanging:
bash
undefined所有CLI命令都需要携带超时参数避免挂起:
bash
undefinedRecommended timeout settings for PTS operations
PTS操作推荐的超时设置
--read-timeout 60 --connect-timeout 10
- **read-timeout**: 60 seconds (stress testing operations may take longer)
- **connect-timeout**: 10 seconds--read-timeout 60 --connect-timeout 10
- **read-timeout**:60秒(压测操作耗时可能较长)
- **connect-timeout**:10秒Environment Variables
环境变量
No additional environment variables required beyond CLI authentication.
除CLI鉴权外无需额外环境变量。
Parameter Confirmation
参数确认
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, scene names, target URLs, concurrency, duration, JMX files, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
重要提示:参数确认 — 执行任何命令或API调用前,所有用户可自定义参数(例如RegionId、场景名称、目标URL、并发数、时长、JMX文件等)必须与用户确认。未获得用户明确批准前,请勿假设或使用默认值。
User-Customizable Parameters
用户可自定义参数
| Parameter Name | Required | Description | Default Value |
|---|---|---|---|
| RegionId | No | Region for PTS service | cn-hangzhou |
| Scene Name | Yes | Name of the stress testing scenario | - |
| Target URL | Yes | URL to stress test | - |
| HTTP Method | Yes | GET, POST, PUT, DELETE, etc. | GET |
| Concurrency | Yes | Number of concurrent users | - |
| Duration | Yes | Test duration in seconds | - |
| JMX File | Yes (JMeter) | Path to JMeter script file | - |
| Mode | No | CONCURRENCY or TPS | CONCURRENCY |
| 参数名称 | 必填 | 说明 | 默认值 |
|---|---|---|---|
| RegionId | 否 | PTS服务所属地域 | cn-hangzhou |
| Scene Name | 是 | 压测场景名称 | - |
| Target URL | 是 | 压测目标URL | - |
| HTTP Method | 是 | GET、POST、PUT、DELETE等 | GET |
| Concurrency | 是 | 并发用户数 | - |
| Duration | 是 | 测试时长,单位秒 | - |
| JMX File | JMeter场景必填 | JMeter脚本文件路径 | - |
| Mode | 否 | CONCURRENCY或TPS | CONCURRENCY |
Authentication
鉴权
This skill relies on the Aliyun CLI's default credential chain. Ensure your CLI is already authenticated before use.
Verify current authentication:
bash
aliyun configure getIf CLI is not yet configured, see references/cli-installation-guide.md for setup instructions.
本技能依赖Aliyun CLI的默认凭证链,使用前请确保您的CLI已完成鉴权。
验证当前鉴权状态:
bash
aliyun configure get如果CLI尚未配置,请参考 references/cli-installation-guide.md 完成设置。
RAM Policy
RAM策略
Users must have appropriate PTS permissions. See references/ram-policies.md for detailed policies.
用户需要拥有对应的PTS权限,详细策略请参考 references/ram-policies.md。
Idempotency
幂等性
PTS APIs do not support -based idempotency. Scene names are not unique — multiple
PTS or JMeter scenarios may share the same . Never treat “same name” as one resource;
always use (returned by the API) as the stable identifier.
ClientTokenSceneNameSceneIdTo prevent duplicate resources or unintended side-effects when retrying after timeouts or errors,
always use the check-then-act pattern before every write operation:
| Operation | Check Before Acting | If Already Exists / Running |
|---|---|---|
Create PTS scene ( | Do not dedupe by name. After success, record | If the prior call outcome is unknown, use |
Create JMeter scene ( | Same as PTS — names may duplicate; use | Same pattern with |
Start PTS test ( | | If |
Start JMeter test ( | | If already running, skip; do NOT start again |
Delete PTS scene ( | Confirm target | If that |
Delete JMeter scene ( | Confirm target | If that |
PTS API不支持基于的幂等性。场景名称不唯一 — 多个PTS或JMeter场景可以使用相同的。请勿将“同名”视为同一个资源,始终使用API返回的****作为稳定标识符。
ClientTokenSceneNameSceneId为避免超时或错误后重试时产生重复资源或非预期副作用,每次写操作前必须使用「先检查后执行」模式:
| 操作 | 执行前检查 | 已存在/运行中处理逻辑 |
|---|---|---|
创建PTS场景 ( | 不要按名称去重,创建成功后记录 | 如果之前调用的结果未知,重试前先调用 |
创建JMeter场景 ( | 和PTS场景一致 — 名称可能重复,仅使用 | 重试前使用 |
启动PTS测试 ( | 调用 | 如果状态为 |
启动JMeter测试 ( | 调用 | 如果已在运行,跳过执行,不要重复启动 |
删除PTS场景 ( | 确认目标** | 如果 |
删除JMeter场景 ( | 确认目标** | 如果 |
Core Workflow
核心工作流
IMPORTANT: Parameter Confirmation — Before executing any command or API call, ALL user-customizable parameters (e.g., RegionId, scene names, target URLs, concurrency, duration, etc.) MUST be confirmed with the user. Do NOT assume or use default values without explicit user approval.
重要提示:参数确认 — 执行任何命令或API调用前,所有用户可自定义参数(例如RegionId、场景名称、目标URL、并发数、时长等)必须与用户确认。未获得用户明确批准前,请勿假设或使用默认值。
Workflow 1: Create and Run PTS Native Stress Testing
工作流1:创建并运行PTS原生压测
Task 1.1: Create PTS Scenario
任务1.1:创建PTS场景
Note: Useinstead ofsave-pts-scene. Thecreate-pts-sceneparameter accepts a JSON object directly (not wrapped in a--scenefield).Scene
Idempotency:may duplicate across scenarios. Do not skip creation or pick a scene based on name alone. AfterSceneNamesucceeds, record the returnedsave-pts-scenefor all later steps. If the command fails or times out with unknown outcome, useSceneIdtogether with the user to identify the intendedlist-pts-scenebefore retrying — avoid blind retries that create extra scenes.SceneId
bash
aliyun pts save-pts-scene \
--scene '{
"SceneName": "<SCENE_NAME>",
"RelationList": [
{
"RelationName": "serial-link-1",
"ApiList": [
{
"ApiName": "api-1",
"Url": "<TARGET_URL>",
"Method": "<HTTP_METHOD>",
"TimeoutInSecond": 10,
"RedirectCountLimit": 10,
"HeaderList": [
{
"HeaderName": "User-Agent",
"HeaderValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
],
"CheckPointList": [
{
"CheckPoint": "",
"CheckType": "STATUS_CODE",
"Operator": "eq",
"ExpectValue": "200"
}
]
}
]
}
],
"LoadConfig": {
"TestMode": "concurrency_mode",
"MaxRunningTime": <DURATION_MINUTES>,
"AutoStep": false,
"Configuration": {
"AllConcurrencyBegin": <CONCURRENCY>,
"AllConcurrencyLimit": <CONCURRENCY>
}
},
"AdvanceSetting": {
"LogRate": 1,
"ConnectionTimeoutInSecond": 5
}
}' \
--user-agent AlibabaCloud-Agent-SkillsParameter Notes:
- : Duration in minutes (not seconds), range [1-1440]
MaxRunningTime - : Use
TestModefor concurrent user testing orconcurrency_modefor RPS testingtps_mode - : Request timeout in seconds (recommended: 10)
TimeoutInSecond - : Maximum redirects allowed (use
RedirectCountLimitfor normal,10to disable)0 - : HTTP headers, User-Agent is recommended for better compatibility
HeaderList - : Assertions for response validation (STATUS_CODE, BODY_JSON, etc.)
CheckPointList - : Log sampling rate (1-100)
AdvanceSetting.LogRate - : Connection timeout (recommended: 5)
AdvanceSetting.ConnectionTimeoutInSecond
For complete JSON structure with all fields (POST requests, file parameters, global variables, etc.), see references/pts-scene-json-reference.md
注意: 使用而非save-pts-scene,create-pts-scene参数直接传入JSON对象(不需要包裹在--scene字段中)。Scene
幂等性说明: 不同场景的可能重复,请勿仅根据名称跳过创建或选择场景。SceneName执行成功后,记录返回的**save-pts-scene**用于后续所有步骤。如果命令失败或超时导致结果未知,重试前先调用SceneId并与用户共同确认目标list-pts-scene,避免盲目重试创建多余场景。SceneId
bash
aliyun pts save-pts-scene \
--scene '{
"SceneName": "<SCENE_NAME>",
"RelationList": [
{
"RelationName": "serial-link-1",
"ApiList": [
{
"ApiName": "api-1",
"Url": "<TARGET_URL>",
"Method": "<HTTP_METHOD>",
"TimeoutInSecond": 10,
"RedirectCountLimit": 10,
"HeaderList": [
{
"HeaderName": "User-Agent",
"HeaderValue": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36"
}
],
"CheckPointList": [
{
"CheckPoint": "",
"CheckType": "STATUS_CODE",
"Operator": "eq",
"ExpectValue": "200"
}
]
}
]
}
],
"LoadConfig": {
"TestMode": "concurrency_mode",
"MaxRunningTime": <DURATION_MINUTES>,
"AutoStep": false,
"Configuration": {
"AllConcurrencyBegin": <CONCURRENCY>,
"AllConcurrencyLimit": <CONCURRENCY>
}
},
"AdvanceSetting": {
"LogRate": 1,
"ConnectionTimeoutInSecond": 5
}
}' \
--user-agent AlibabaCloud-Agent-Skills参数说明:
- : 测试时长,单位分钟(不是秒),取值范围[1-1440]
MaxRunningTime - : 并发用户测试使用
TestMode,RPS测试使用concurrency_modetps_mode - : 请求超时时间,单位秒(推荐值:10)
TimeoutInSecond - : 最大允许重定向次数(常规场景使用
RedirectCountLimit,填10可禁用重定向)0 - : HTTP请求头,推荐携带User-Agent提升兼容性
HeaderList - : 响应校验断言(支持STATUS_CODE、BODY_JSON等类型)
CheckPointList - : 日志采样率(取值1-100)
AdvanceSetting.LogRate - : 连接超时时间(推荐值:5)
AdvanceSetting.ConnectionTimeoutInSecond
完整的JSON结构(含POST请求、文件参数、全局变量等)请参考 references/pts-scene-json-reference.md
Task 1.2: Start Stress Testing
任务1.2:启动压测
[MUST] Pre-flight Safety Checks — Starting a stress test sends significant traffic to the target system. ALL of the following checks MUST pass before executing:start-pts-scene
- Idempotency guard — Run
. If the status isget-pts-scene-running-status --scene-id <SCENE_ID>orRUNNING, the test is already in progress — skip the start command and proceed to monitoring. Do NOT start a duplicate test.SYNCING- Retrieve and verify scene configuration — Run
and confirm the response contains a validget-pts-scene --scene-id <SCENE_ID>, at least oneSceneNameentry with a non-emptyRelationList, and a validUrl(non-zeroLoadConfigand concurrency). If any field is missing or empty, abort and notify the user.MaxRunningTime- Display test summary and require explicit user confirmation — Present the following to the user and wait for explicit approval (e.g., "yes" / "确认"):
Do NOT proceed without the user's explicit "go-ahead" confirmation.
- Target URL(s)
- Concurrency level
- Test duration
- Test mode (concurrency / TPS)
bash
undefined[必须] 前置安全检查 — 启动压测会向目标系统发送大量流量,执行前必须通过所有以下检查:start-pts-scene
- 幂等性防护 — 运行
,如果状态为get-pts-scene-running-status --scene-id <SCENE_ID>或RUNNING,说明测试已经在运行中,跳过启动命令直接进入监控流程,不要启动重复测试。SYNCING- 拉取并验证场景配置 — 运行
,确认返回结果包含有效的get-pts-scene --scene-id <SCENE_ID>、至少一个包含非空SceneName的Url条目,以及有效的RelationList(非零的LoadConfig和并发数)。如果有字段缺失或为空,终止操作并通知用户。MaxRunningTime- 展示测试摘要并要求用户明确确认 — 向用户展示以下信息并等待明确批准(例如"yes"/"确认"):
- 目标URL列表
- 并发量级
- 测试时长
- 测试模式(并发/TPS)
未获得用户明确的「同意执行」确认前,请勿继续操作。
bash
undefinedIdempotency guard: Skip if test is already running
幂等性防护:如果测试已在运行则跳过启动
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
↑ If status is RUNNING or SYNCING, skip start-pts-scene and go to monitoring.
↑ 如果状态为RUNNING或SYNCING,跳过start-pts-scene直接进入监控流程
Pre-flight check: Verify scene configuration is complete
前置检查:验证场景配置完整
aliyun pts get-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
Start stress testing (only after all checks pass and user confirms)
启动压测(仅在所有检查通过且用户确认后执行)
aliyun pts start-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedaliyun pts start-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedTask 1.3: Monitor Testing Status
任务1.3:监控测试状态
bash
aliyun pts get-pts-scene-running-status \
--scene-id <SCENE_ID> \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts get-pts-scene-running-status \
--scene-id <SCENE_ID> \
--user-agent AlibabaCloud-Agent-SkillsTask 1.4: Get Testing Report
任务1.4:获取测试报告
bash
aliyun pts get-pts-report-details \
--scene-id <SCENE_ID> \
--plan-id <PLAN_ID> \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts get-pts-report-details \
--scene-id <SCENE_ID> \
--plan-id <PLAN_ID> \
--user-agent AlibabaCloud-Agent-SkillsWorkflow 2: Create and Run JMeter Stress Testing
工作流2:创建并运行JMeter压测
Task 2.1: Create JMeter Scenario
任务2.1:创建JMeter场景
Idempotency:may duplicate across JMeter scenarios. Do not dedupe by name. AfterSceneNamesucceeds, record the returnedsave-open-jmeter-scene. On uncertain failure, useSceneIdwith the user to disambiguate before retrying.list-open-jmeter-scenes
bash
aliyun pts save-open-jmeter-scene \
--open-jmeter-scene '{
"SceneName": "<SCENE_NAME>",
"TestFile": "<JMX_FILENAME>",
"Duration": <DURATION>,
"Concurrency": <CONCURRENCY>,
"Mode": "CONCURRENCY"
}' \
--user-agent AlibabaCloud-Agent-Skills幂等性说明: 不同JMeter场景的可能重复,请勿按名称去重。SceneName执行成功后,记录返回的**save-open-jmeter-scene**。如果调用失败结果未知,重试前先调用SceneId并与用户共同确认目标场景。list-open-jmeter-scenes
bash
aliyun pts save-open-jmeter-scene \
--open-jmeter-scene '{
"SceneName": "<SCENE_NAME>",
"TestFile": "<JMX_FILENAME>",
"Duration": <DURATION>,
"Concurrency": <CONCURRENCY>,
"Mode": "CONCURRENCY"
}' \
--user-agent AlibabaCloud-Agent-SkillsTask 2.2: Start JMeter Testing
任务2.2:启动JMeter测试
[MUST] Pre-flight Safety Checks — Starting a JMeter stress test sends significant traffic to the target system. ALL of the following checks MUST pass before executing:start-testing-jmeter-scene
- Idempotency guard — Run
and check the scene status. If the test is already running, skip the start command and proceed to monitoring. Do NOT start a duplicate test.get-open-jmeter-scene --scene-id <SCENE_ID>- Verify scene configuration — From the same response, confirm it contains a valid
, a non-emptySceneName, and non-zeroTestFileandDuration. If any field is missing or empty, abort and notify the user.Concurrency- Display test summary and require explicit user confirmation — Present the following to the user and wait for explicit approval (e.g., "yes" / "确认"):
Do NOT proceed without the user's explicit "go-ahead" confirmation.
- Scene name and JMX file
- Concurrency level
- Test duration
bash
undefined[必须] 前置安全检查 — 启动JMeter压测会向目标系统发送大量流量,执行前必须通过所有以下检查:start-testing-jmeter-scene
- 幂等性防护 — 运行
检查场景状态,如果测试已经在运行中,跳过启动命令直接进入监控流程,不要启动重复测试。get-open-jmeter-scene --scene-id <SCENE_ID>- 验证场景配置 — 从上述接口的返回结果中,确认包含有效的
、非空的SceneName、非零的TestFile和Duration。如果有字段缺失或为空,终止操作并通知用户。Concurrency- 展示测试摘要并要求用户明确确认 — 向用户展示以下信息并等待明确批准(例如"yes"/"确认"):
- 场景名称和JMX文件
- 并发量级
- 测试时长
未获得用户明确的「同意执行」确认前,请勿继续操作。
bash
undefinedIdempotency guard + pre-flight check: Verify scene config and check if already running
幂等性防护+前置检查:验证场景配置并检查是否已在运行
aliyun pts get-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
↑ If already running, skip start command. If config is incomplete, abort.
↑ 如果已在运行则跳过启动命令,如果配置不完整则终止操作
Start JMeter testing (only after all checks pass and user confirms)
启动JMeter测试(仅在所有检查通过且用户确认后执行)
aliyun pts start-testing-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedaliyun pts start-testing-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedTask 2.3: Get JMeter Report
任务2.3:获取JMeter报告
bash
aliyun pts get-jmeter-report-details \
--report-id <REPORT_ID> \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts get-jmeter-report-details \
--report-id <REPORT_ID> \
--user-agent AlibabaCloud-Agent-SkillsWorkflow 3: Manage Scenarios
工作流3:场景管理
Task 3.1: List All PTS Scenarios
任务3.1:列出所有PTS场景
bash
aliyun pts list-pts-scene \
--page-number 1 \
--page-size 10 \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts list-pts-scene \
--page-number 1 \
--page-size 10 \
--user-agent AlibabaCloud-Agent-SkillsTask 3.2: List All JMeter Scenarios
任务3.2:列出所有JMeter场景
bash
aliyun pts list-open-jmeter-scenes \
--page-number 1 \
--page-size 10 \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts list-open-jmeter-scenes \
--page-number 1 \
--page-size 10 \
--user-agent AlibabaCloud-Agent-SkillsTask 3.3: Get Scenario Details
任务3.3:获取场景详情
bash
undefinedbash
undefinedPTS scenario
PTS场景
aliyun pts get-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
JMeter scenario
JMeter场景
aliyun pts get-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedaliyun pts get-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedTask 3.4: Debug Scenario (PTS only)
任务3.4:调试场景(仅PTS支持)
bash
aliyun pts start-debug-pts-scene \
--scene-id <SCENE_ID> \
--user-agent AlibabaCloud-Agent-Skillsbash
aliyun pts start-debug-pts-scene \
--scene-id <SCENE_ID> \
--user-agent AlibabaCloud-Agent-SkillsTask 3.5: Stop Running Test
任务3.5:停止运行中的测试
bash
undefinedbash
undefinedStop PTS test
停止PTS测试
aliyun pts stop-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts stop-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
Stop JMeter test
停止JMeter测试
aliyun pts stop-testing-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedaliyun pts stop-testing-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedSuccess Verification Method
成功验证方法
IMPORTANT:may returnstart-pts-sceneeven when the stress test fails to actually launch (e.g., due to target site protection or missing configuration). Always verify actual execution status.Success: true
After each operation, verify success using the verification commands in references/verification-method.md.
Verify scenario creation:
bash
undefined重要提示: 即使返回start-pts-scene,压测也可能实际启动失败(例如目标站点有防护、配置缺失等问题),请始终验证实际执行状态。Success: true
每次操作完成后,请使用 references/verification-method.md 中的验证命令确认操作成功。
验证场景创建成功:
bash
undefinedUse list-pts-scene instead of get-pts-scene (more reliable)
使用list-pts-scene比get-pts-scene更可靠
aliyun pts list-pts-scene
--page-number 1
--page-size 10
--user-agent AlibabaCloud-Agent-Skills
--page-number 1
--page-size 10
--user-agent AlibabaCloud-Agent-Skills
**Verify stress test is actually running:**
```bashaliyun pts list-pts-scene
--page-number 1
--page-size 10
--user-agent AlibabaCloud-Agent-Skills
--page-number 1
--page-size 10
--user-agent AlibabaCloud-Agent-Skills
**验证压测实际在运行:**
```bashCheck running status first
先检查运行状态
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
Then verify with running data (requires plan-id from start-pts-scene)
再通过运行数据验证(需要使用start-pts-scene返回的plan-id)
aliyun pts get-pts-scene-running-data
--scene-id <SCENE_ID>
--plan-id <PLAN_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--plan-id <PLAN_ID>
--user-agent AlibabaCloud-Agent-Skills
**Key indicators of successful execution:**
- `Status`: Should be "RUNNING" or "SYNCING" (not "STOPPED" immediately)
- `AliveAgents`: Should be > 0
- `Concurrency`: Should match configured value
- `TotalRequestCount`: Should be increasingaliyun pts get-pts-scene-running-data
--scene-id <SCENE_ID>
--plan-id <PLAN_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--plan-id <PLAN_ID>
--user-agent AlibabaCloud-Agent-Skills
**执行成功的关键指标:**
- `Status`: 应为"RUNNING"或"SYNCING"(不会立即变为"STOPPED")
- `AliveAgents`: 应大于0
- `Concurrency`: 应与配置值匹配
- `TotalRequestCount`: 应持续增长Cleanup
清理
Delete scenarios when no longer needed.
[MUST] Pre-delete Safety Checks — Before deleting any scenario, ALL of the following checks MUST pass:
- Idempotency guard — Using the target
(not name), verify it still exists (e.g.SceneId/list-pts-sceneorlist-open-jmeter-scenes). If thatget-*is absent, treat deletion as already done and skip the delete command.SceneId- Check if the scenario is currently running — Run
(PTS) or check JMeter scene status. If the scenario status isget-pts-scene-running-status --scene-id <SCENE_ID>orRUNNING, you MUST stop it first usingSYNCING/stop-pts-sceneand wait for it to fully stop before deleting. Do NOT delete a running scenario.stop-testing-jmeter-scene- Require explicit user confirmation — Display the scene name and ID to the user and ask for explicit deletion confirmation (e.g., "yes" / "确认删除"). Do NOT proceed without the user's explicit approval.
bash
undefined不再需要的场景请及时删除。
[必须] 删除前安全检查 — 删除任何场景前,必须通过所有以下检查:
- 幂等性防护 — 使用目标**
**(不是名称)验证场景仍存在(例如调用SceneId/list-pts-scene或对应的get接口)。如果list-open-jmeter-scenes不存在,视为已完成删除,跳过删除命令。SceneId- 检查场景是否正在运行 — 调用
(PTS场景)或检查JMeter场景状态。如果场景状态为get-pts-scene-running-status --scene-id <SCENE_ID>或RUNNING,必须先使用SYNCING/stop-pts-scene停止测试,等待完全停止后再删除,请勿删除运行中的场景。stop-testing-jmeter-scene- 要求用户明确确认 — 向用户展示场景名称和ID,要求明确的删除确认(例如"yes"/"确认删除")。未获得用户明确批准前,请勿继续操作。
bash
undefinedPre-delete check: Verify scenario is not running
删除前检查:验证场景未在运行
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts get-pts-scene-running-status
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
Delete PTS scenario (only after confirming it is not running and user approves)
删除PTS场景(仅在确认未运行且用户批准后执行)
aliyun pts delete-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
aliyun pts delete-pts-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
Delete JMeter scenario (only after confirming it is not running and user approves)
删除JMeter场景(仅在确认未运行且用户批准后执行)
aliyun pts remove-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedaliyun pts remove-open-jmeter-scene
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
--scene-id <SCENE_ID>
--user-agent AlibabaCloud-Agent-Skills
undefinedAPI and Command Tables
API和命令表
See references/related-apis.md for complete API and CLI command reference.
完整的API和CLI命令参考请查看 references/related-apis.md。
Best Practices
最佳实践
- Use complete scene configuration - Always include ,
TimeoutInSecond(with User-Agent),HeaderList, andCheckPointListfor reliable test executionAdvanceSetting - Always confirm parameters - Verify target URLs, concurrency settings, and duration with the user before execution
- Start with low concurrency - Begin with low concurrency and gradually increase to identify performance thresholds
- Verify actual execution - Don't trust from
Success: true; always checkstart-pts-scenewithget-pts-scene-running-data--plan-id - Use debug mode first - For PTS scenarios, use to validate configuration before full tests
start-debug-pts-scene - Monitor during tests - Regularly check running status during stress tests
- Review reports thoroughly - Analyze response times, error rates, and throughput in reports
- Clean up after testing - Delete test scenarios to avoid unnecessary costs
- Use appropriate test duration - Longer tests provide more accurate results but consume more resources
- Include warmup period - Allow time for systems to warm up before measuring peak performance
- 使用完整的场景配置 - 始终携带、
TimeoutInSecond(含User-Agent)、HeaderList和CheckPointList,确保测试执行可靠AdvanceSetting - 始终确认参数 - 执行前与用户确认目标URL、并发设置和时长
- 从低并发开始测试 - 先使用低并发启动,逐步提升量级,确认性能阈值
- 验证实际执行状态 - 不要信任返回的
start-pts-scene,始终通过Success: true配合get-pts-scene-running-data校验--plan-id - 优先使用调试模式 - PTS场景正式测试前,先使用验证配置有效性
start-debug-pts-scene - 测试过程中持续监控 - 压测期间定期检查运行状态
- 完整分析报告 - 详细分析报告中的响应时间、错误率和吞吐量数据
- 测试完成后清理资源 - 删除测试场景避免产生不必要的费用
- 使用合适的测试时长 - 更长的测试时长可提供更准确的结果,但会消耗更多资源
- 预留预热时间 - 测量峰值性能前,预留系统预热时间
Reference Links
参考链接
| Reference | Description |
|---|---|
| cli-installation-guide.md | Aliyun CLI installation and configuration |
| related-apis.md | Complete API and CLI command reference |
| ram-policies.md | RAM permission policies |
| verification-method.md | Verification steps for each operation |
| pts-scene-json-reference.md | Complete PTS scene JSON structure reference |
| acceptance-criteria.md | Acceptance criteria for skill validation |
| 参考文档 | 说明 |
|---|---|
| cli-installation-guide.md | Aliyun CLI安装与配置指南 |
| related-apis.md | 完整API和CLI命令参考 |
| ram-policies.md | RAM权限策略说明 |
| verification-method.md | 各操作的验证步骤 |
| pts-scene-json-reference.md | 完整PTS场景JSON结构参考 |
| acceptance-criteria.md | 技能验证的验收标准 |