Skip to content

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

Step 1: Create a Mock Interface
Configure the interface name, method, path, and description.
09-mock-api-add.png

Step 2: Define Response Rules
Set the response name, status code, content, and matching priority.
09-mock-response-add.png

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:

  1. Copy the script above into a text file.
  2. Go to the AngusTester console: Mock Service → Interfaces → New Interface.
  3. Select "Import Interface" to complete the configuration.

Benchmark Interface Validation Methods

Method 1: Visual Debugging Interface

  1. Navigate to the Mock interface details page.
  2. Click the "Test Request" button on the right.
  3. Send a request to verify the response.

09-mock-api-debug.png

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 TypeConfiguration OptionsPerformance Significance
Response DelayFixed/Random DelaySimulates real business processing time
Response Status200/400/500, etc.Validates error handling in different scenarios
Throughput ControlTPS LimitSimulates system pressure limits
Content GenerationDynamic ParametersSupports 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

  1. Exception Simulation: It is recommended to set a 1% random error response rate during performance testing to simulate real-world fluctuations.
  2. Delay Setting Principle: Benchmark delay = Production environment P99 delay × 0.8

Create Your Benchmark Testing Interface Now: 🔗 Go to AngusTester Console 🔗

Last updated:

Released under the GPL-3.0 License.