当前位置: 首页 > Skill >

Alibabacloud Pts Ops

Alibabacloud Pts Ops

0.0.1 2026.11.12 浏览:422
获取Skill文件查看使用说明
作者:江川许可证:
本文目录展开

Alibaba Cloud PTS Stress Testing Scenario Management

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.

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:

  1. PTS Native Stress Testing - Create HTTP/HTTPS stress testing scenarios with configurable APIs, serial links, and load models
  2. JMeter Stress Testing - Upload and run JMeter scripts with distributed load generation

Architecture

User → Aliyun CLI → PTS Service → Target Application
                         ↓
                   Stress Testing Report

Pre-check

Pre-check: Aliyun CLI >= 3.3.1 required Run aliyun version to verify >= 3.3.1. If not installed or version too low, see references/cli-installation-guide.md for installation instructions. Then [MUST] run aliyun configure set --auto-plugin-install true to enable automatic plugin installation.

# Verify CLI version
aliyun version

# Enable auto plugin installation
aliyun configure set --auto-plugin-install true

Timeout Settings

All CLI commands should include timeout parameters to avoid hanging:

# Recommended timeout settings for PTS operations
--read-timeout 60 --connect-timeout 10
  • read-timeout: 60 seconds (stress testing operations may take longer)
  • connect-timeout: 10 seconds

Environment Variables

No additional environment variables required beyond CLI authentication.

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.

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

Authentication

This skill relies on the Aliyun CLI's default credential chain. Ensure your CLI is already authenticated before use.

Verify current authentication:

aliyun configure get

If CLI is not yet configured, see references/cli-installation-guide.md for setup instructions.

RAM Policy

Users must have appropriate PTS permissions. See references/ram-policies.md for detailed policies.

Idempotency

PTS APIs do not support ClientToken-based idempotency. Scene names are not unique — multiple PTS or JMeter scenarios may share the same SceneName. Never treat “same name” as one resource; always use SceneId (returned by the API) as the stable identifier.

To 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 (save-pts-scene) Do not dedupe by name. After success, record SceneId. If the prior call outcome is unknown, use list-pts-scene with the user to disambiguate before retrying; do not blindly retry save (each retry may create another scene).
Create JMeter scene (save-open-jmeter-scene) Same as PTS — names may duplicate; use SceneId only. Same pattern with list-open-jmeter-scenes + user disambiguation before retry.
Start PTS test (start-pts-scene) get-pts-scene-running-status — check status If RUNNING or SYNCING, skip; do NOT start again
Start JMeter test (start-testing-jmeter-scene) get-open-jmeter-scene — check status If already running, skip; do NOT start again
Delete PTS scene (delete-pts-scene) Confirm target SceneId still exists (e.g. list-pts-scene / get-pts-scene) If that SceneId is gone, treat as success (already deleted)
Delete JMeter scene (remove-open-jmeter-scene) Confirm target SceneId still exists If that SceneId is gone, treat as success (already deleted)

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.

Workflow 1: Create and Run PTS Native Stress Testing

Task 1.1: Create PTS Scenario

Note: Use save-pts-scene instead of create-pts-scene. The --scene parameter accepts a JSON object directly (not wrapped in a Scene field).

Idempotency: SceneName may duplicate across scenarios. Do not skip creation or pick a scene based on name alone. After save-pts-scene succeeds, record the returned SceneId for all later steps. If the command fails or times out with unknown outcome, use list-pts-scene together with the user to identify the intended SceneId before retrying — avoid blind retries that create extra scenes.

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

Parameter Notes:

  • MaxRunningTime: Duration in minutes (not seconds), range [1-1440]
  • TestMode: Use concurrency_mode for concurrent user testing or tps_mode for RPS testing
  • TimeoutInSecond: Request timeout in seconds (recommended: 10)
  • RedirectCountLimit: Maximum redirects allowed (use 10 for normal, 0 to disable)
  • HeaderList: HTTP headers, User-Agent is recommended for better compatibility
  • CheckPointList: Assertions for response validation (STATUS_CODE, BODY_JSON, etc.)
  • AdvanceSetting.LogRate: Log sampling rate (1-100)
  • AdvanceSetting.ConnectionTimeoutInSecond: Connection timeout (recommended: 5)

For complete JSON structure with all fields (POST requests, file parameters, global variables, etc.), see references/pts-scene-json-reference.md

Task 1.2: Start Stress Testing

[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:

  1. Idempotency guard — Run get-pts-scene-running-status --scene-id <SCENE_ID>. If the status is RUNNING or SYNCING, the test is already in progress — skip the start command and proceed to monitoring. Do NOT start a duplicate test.

  2. Retrieve and verify scene configuration — Run get-pts-scene --scene-id <SCENE_ID> and confirm the response contains a valid SceneName, at least one RelationList entry with a non-empty Url, and a valid LoadConfig (non-zero MaxRunningTime and concurrency). If any field is missing or empty, abort and notify the user.

  3. Display test summary and require explicit user confirmation — Present the following to the user and wait for explicit approval (e.g., "yes" / "确认"):

    • Target URL(s)
    • Concurrency level
    • Test duration
    • Test mode (concurrency / TPS)

    Do NOT proceed without the user's explicit "go-ahead" confirmation.

# Idempotency guard: Skip if test is already running
aliyun pts get-pts-scene-running-status 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills
# ↑ If status is RUNNING or SYNCING, skip start-pts-scene and go to monitoring.

# Pre-flight check: Verify scene configuration is complete
aliyun pts get-pts-scene 
  --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

Task 1.3: Monitor Testing Status

aliyun pts get-pts-scene-running-status 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Task 1.4: Get Testing Report

aliyun pts get-pts-report-details 
  --scene-id <SCENE_ID> 
  --plan-id <PLAN_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Workflow 2: Create and Run JMeter Stress Testing

Task 2.1: Create JMeter Scenario

Idempotency: SceneName may duplicate across JMeter scenarios. Do not dedupe by name. After save-open-jmeter-scene succeeds, record the returned SceneId. On uncertain failure, use list-open-jmeter-scenes with the user to disambiguate before retrying.

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

Task 2.2: Start JMeter Testing

[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:

  1. Idempotency guard — Run get-open-jmeter-scene --scene-id <SCENE_ID> 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.

  2. Verify scene configuration — From the same response, confirm it contains a valid SceneName, a non-empty TestFile, and non-zero Duration and Concurrency. If any field is missing or empty, abort and notify the user.

  3. Display test summary and require explicit user confirmation — Present the following to the user and wait for explicit approval (e.g., "yes" / "确认"):

    • Scene name and JMX file
    • Concurrency level
    • Test duration

    Do NOT proceed without the user's explicit "go-ahead" confirmation.

# Idempotency 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
# ↑ If already running, skip start command. If config is incomplete, abort.

# Start JMeter testing (only after all checks pass and user confirms)
aliyun pts start-testing-jmeter-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Task 2.3: Get JMeter Report

aliyun pts get-jmeter-report-details 
  --report-id <REPORT_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Workflow 3: Manage Scenarios

Task 3.1: List All PTS Scenarios

aliyun pts list-pts-scene 
  --page-number 1 
  --page-size 10 
  --user-agent AlibabaCloud-Agent-Skills

Task 3.2: List All JMeter Scenarios

aliyun pts list-open-jmeter-scenes 
  --page-number 1 
  --page-size 10 
  --user-agent AlibabaCloud-Agent-Skills

Task 3.3: Get Scenario Details

# PTS scenario
aliyun pts get-pts-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

# JMeter scenario
aliyun pts get-open-jmeter-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Task 3.4: Debug Scenario (PTS only)

aliyun pts start-debug-pts-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Task 3.5: Stop Running Test

# Stop PTS test
aliyun pts stop-pts-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

# Stop JMeter test
aliyun pts stop-testing-jmeter-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

Success Verification Method

IMPORTANT: start-pts-scene may return Success: true even when the stress test fails to actually launch (e.g., due to target site protection or missing configuration). Always verify actual execution status.

After each operation, verify success using the verification commands in references/verification-method.md.

Verify scenario creation:

# Use list-pts-scene instead of get-pts-scene (more reliable)
aliyun pts list-pts-scene 
  --page-number 1 
  --page-size 10 
  --user-agent AlibabaCloud-Agent-Skills

Verify stress test is actually running:

# Check running status first
aliyun pts get-pts-scene-running-status 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

# Then verify with running data (requires plan-id from start-pts-scene)
aliyun pts get-pts-scene-running-data 
  --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 increasing

Cleanup

Delete scenarios when no longer needed.

[MUST] Pre-delete Safety Checks — Before deleting any scenario, ALL of the following checks MUST pass:

  1. Idempotency guard — Using the target SceneId (not name), verify it still exists (e.g. list-pts-scene / list-open-jmeter-scenes or get-*). If that SceneId is absent, treat deletion as already done and skip the delete command.
  2. Check if the scenario is currently running — Run get-pts-scene-running-status --scene-id <SCENE_ID> (PTS) or check JMeter scene status. If the scenario status is RUNNING or SYNCING, you MUST stop it first using stop-pts-scene / stop-testing-jmeter-scene and wait for it to fully stop before deleting. Do NOT delete a running scenario.
  3. 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.
# Pre-delete check: Verify scenario is not running
aliyun pts get-pts-scene-running-status 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

# Delete PTS scenario (only after confirming it is not running and user approves)
aliyun pts delete-pts-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

# Delete JMeter scenario (only after confirming it is not running and user approves)
aliyun pts remove-open-jmeter-scene 
  --scene-id <SCENE_ID> 
  --user-agent AlibabaCloud-Agent-Skills

API and Command Tables

See references/related-apis.md for complete API and CLI command reference.

Best Practices

  1. Use complete scene configuration - Always include TimeoutInSecond, HeaderList (with User-Agent), CheckPointList, and AdvanceSetting for reliable test execution
  2. Always confirm parameters - Verify target URLs, concurrency settings, and duration with the user before execution
  3. Start with low concurrency - Begin with low concurrency and gradually increase to identify performance thresholds
  4. Verify actual execution - Don't trust Success: true from start-pts-scene; always check get-pts-scene-running-data with --plan-id
  5. Use debug mode first - For PTS scenarios, use start-debug-pts-scene to validate configuration before full tests
  6. Monitor during tests - Regularly check running status during stress tests
  7. Review reports thoroughly - Analyze response times, error rates, and throughput in reports
  8. Clean up after testing - Delete test scenarios to avoid unnecessary costs
  9. Use appropriate test duration - Longer tests provide more accurate results but consume more resources
  10. Include warmup period - Allow time for systems to warm up before measuring peak performance

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

推荐文章

更多
PHP时间戳与日期字符串相互转换方法详解

本文介绍PHP中时间数值(Unix时间戳)与日期字符串之间的相互转换方法。通过strtotime和date函数,实现将当前时间、指定日期转换为时间戳,以及将时间戳格式化为可读的日期时间字符串,并提供相关在线计算工具推荐。

2025.11.30 1,040
PHP日期转时间戳时区偏差怎么解决

在 PHP 中将日期字符串转换为时间戳时,若未显式指定时区,默认使用脚本配置的 date.timezone 或系统时区。当服务器时区与业务逻辑预期(如 UTC )不一致时,会产生偏差。解决核心是确保输入字符串携带明确时区信息,或在转换前统一设置时区上下文。

2026.10.24 1,033
JavaScript中利用replace结合正则实现replaceAll效果

JavaScript原生仅支持replace()进行单次或全局替换,缺乏类似Java的replaceAll()便捷方法。本文总结四种在JS中实现全量替换的方案:使用带g标志的正则、带gm标志的正则、扩展String原型以及split后join。通过对比代码示例,展示各方法的实现细节与适用场景,帮助开发者根据需求选择最优解。

2025.04.29 1,021
PHP跨域配置:怎么安全地允许指定域名而非使用通配符

在 PHP 中安全地允许指定域名跨域,核心是解析请求头中的 Origin ,验证其是否在白名单内,然后动态设置 Access-Control-Allow-Origin 响应头。不要使用通配符 * ,也不要硬编码单一域名。

2025.03.29 1,021
PHP实现基础文件上传:HTML表单与$_FILES处理流程

在 HTML 表单中设置 enctype="multipart/form-data" ,并在 PHP 后端通过 $_FILES 数组接收文件,调用 move_uploaded_file() 将临时文件移动到目标目录即可完成上传。

2026.09.07 1,019
OpenAI的Jalapeno芯片未落地,教你分辨300兆瓦算力消息

OpenAI计划在SB Energy租赁的数据中心部署约300兆瓦自研Jalapeno推理芯片,但目前双方仍处于洽谈阶段,交易细节与上线时间表均未公布。本文带你按报道原文核实项目所处阶段,厘清芯片发布、电力功率与实际推理算力的边界,并将融资意向与签约、开工、投运节点分开追踪,避免误将规划容量计入现有算力。

2026.12.02 1,016
Skill 文件
  • SKILL.md
    • Alibaba Cloud PTS Stress Testing Scenario Management
    • Scenario Description
      • Architecture
    • Pre-check
    • Timeout Settings
    • Environment Variables
    • Parameter Confirmation
      • User-Customizable Parameters
    • Authentication
    • RAM Policy
    • Idempotency
    • Core Workflow
      • Workflow 1: Create and Run PTS Native Stress Testing
        • Task 1.1: Create PTS Scenario
        • Task 1.2: Start Stress Testing
        • Task 1.3: Monitor Testing Status
        • Task 1.4: Get Testing Report
      • Workflow 2: Create and Run JMeter Stress Testing
        • Task 2.1: Create JMeter Scenario
        • Task 2.2: Start JMeter Testing
        • Task 2.3: Get JMeter Report
      • Workflow 3: Manage Scenarios
        • Task 3.1: List All PTS Scenarios
        • Task 3.2: List All JMeter Scenarios
        • Task 3.3: Get Scenario Details
        • Task 3.4: Debug Scenario (PTS only)
        • Task 3.5: Stop Running Test
    • Success Verification Method
    • Cleanup
    • API and Command Tables
    • Best Practices
    • Reference Links
  • 项目或源文件

相关 Skill

更多
service-qa-coach service-qa-coach Review support quality for chat, email, phone, social DM, or marketplace service teams. Use when a team needs a QA scorecard, failure-mode analysis, coaching plan, calibration checklist, or service-improvement brief without live ticketing, CRM, or contact-center system access.
高中数学作业批改助手 高中数学作业批改助手 >图片识别 直接读取学生手写作答照片,识别公式、符号、步骤 🧮 自动推导 根据题目自动生成参考答案和评分细则,无需教师预设 📊 逐步给分 每个关键步骤独立评分,体现过程分 📝 结构化报告 输出含识别内容、参考答案、逐步评分、改进建议的完整报告 🗂 批量批改 支持一次性批改多道题,最终汇总得分表
Vibration Analysis Vibration Analysis 分析来自CMS趋势、RMS/峰值、频谱及SCADA报警的风机传动链(主轴、齿轮箱、发电机)振动数据。
Traditional Bone Tool Making Basics Traditional Bone Tool Making Basics Use when you need custom, durable, repairable tools like awls, needles, scrapers, harpoons, or fishing hooks made from local animal bones or antlers and comm...
音频混音工具 音频混音工具 名称:Sound Mixing Tool(标识 sound-mixing-tool) 短简介(≤60字):音乐/音效响度精确对齐 + 融合混音工作流:用 ffmpeg 两段式 loudnorm 把多组素材 LUFS 偏差压到 <0.10,再最小干预融合、导出可进引擎的独立分轨。 标签/关键词:音频混音 响度匹配 LUFS ffmpeg 游戏音频 音效设计 Wwise FMOD 分轨导出 后期处理 触发词:混音 · 响度匹配 · LUFS 对齐 · MIX 版本 · 音乐音效分轨 · 融合 · 不打架 · 不能盖住 适用场景 :游戏音频集成、影视短视频配乐、播客后期