How to Use AngusTester's Mock Service to Generate a Performance Benchmark Testing Interface
Why a Performance Benchmark Testing Interface is Needed
Performance benchmark testing interfaces are critical infrastructure for system robustness verification:
Core Value Matrix
🚀 Performance Evaluation & Optimization
- Obtain real performance metrics: response time, throughput, resource utilization
- Accurately identify performance bottlenecks
- Validate the effectiveness of optimization measures
📊 Capacity Planning & SLA Validation
- Determine system resource requirements
- Predict performance under growth pressure
- Ensure compliance with service-level agreements
🔒 Stability & Risk Control
- Simulate extreme load scenarios
- Detect memory leaks and deadlocks
- Prevent production environment crashes
🔄 Continuous Integration & Version Validation
- Integrate into CI/CD pipelines
- Monitor performance changes in real-time
- Validate version upgrade compatibility
Two-Step Creation of a Mock Benchmark Testing Interface
Method 1: Visual Interface Configuration (Recommended)
Step 1: Create a Mock Interface
Configure the interface name, method, path, and description.
Step 2: Define Response Rules
Set the response name, status code, content, and matching priority.
Method 2: Script Import
yaml
specification: angus/1.0.0
type: MOCK_APIS
task:
mockApis:
- name: Performance Benchmark Test
description: Simulates a fast-response interface without business processing
method: GET
endpoint: /benchmark
responses:
- name: No-Delay Success Response
match:
priority: 1000 # Highest matching priority
content:
status: 200 # HTTP success status code
headers:
- name: Content-Type
value: text/plain
content: Success # Fixed response content
delay:
mode: NONE # No delay, immediate response
Steps:
- Copy the script above into a text file.
- Go to the AngusTester console:
Mock Service → Interfaces → New Interface
. - Select "Import Interface" to complete the configuration.
Benchmark Interface Validation Methods
Method 1: Visual Debugging Interface
- Navigate to the Mock interface details page.
- Click the "Test Request" button on the right.
- Send a request to verify the response.
Expected Results:
- HTTP status code: 200
- Response body: "Success"
Method 2: CURL Command-Line Validation
bash
curl -i 'http://serv01-sample.angusmock.cloud:30010/benchmark'
Expected Response:
http
HTTP/1.1 200 OK
Content-Type: text/plain
content-length: 7
Success
Advantages of Benchmark Testing Interfaces
Precise Control of Performance Parameters
Parameter Type | Configuration Options | Performance Significance |
---|---|---|
Response Delay | Fixed/Random Delay | Simulates real business processing time |
Response Status | 200/400/500, etc. | Validates error handling in different scenarios |
Throughput Control | TPS Limit | Simulates system pressure limits |
Content Generation | Dynamic Parameters | Supports complex data scenario testing |
Professional Use Cases
⚡ Establishing Performance Baselines
- Create zero-delay benchmark testing interfaces
- Obtain pure network-layer performance data
- Eliminate business logic interference
🧩 Complex Scenario Simulation
- Build API dependency chains
- Simulate third-party service responses
- Create abnormal response patterns
🔁 Continuous Integration Validation
- Daily automated performance regression
- Pre-release performance gatekeeping
- Post-resource change validation
Pro Tip
- Exception Simulation: It is recommended to set a 1% random error response rate during performance testing to simulate real-world fluctuations.
- Delay Setting Principle: Benchmark delay = Production environment P99 delay × 0.8
Create Your Benchmark Testing Interface Now: 🔗 Go to AngusTester Console 🔗