Chuyển đến nội dung
Skillpedia
Kiểm thử48k · #5002

k6-load-testing

Skill này làm gì

Công cụ này giúp kiểm tra mức độ nhanh và ổn định của một website hoặc ứng dụng khi nhiều người cùng sử dụng. Nó mô phỏng nhiều người dùng truy cập hệ thống để tìm các vấn đề về hiệu năng.

Khi nào nên dùng

  • ✓Khi bạn muốn biết website có thể chịu được nhiều lượt truy cập cùng lúc hay không.
  • ✓Khi bạn thiết lập kiểm thử tự động để kiểm tra xem hiệu năng có giảm sau một bản cập nhật không.
  • ✓Để hiểu hệ thống phản ứng thế nào với các mức lưu lượng khác nhau.

Liên kết skill

https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/k6-load-testing/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/sickn33/agentic-awesome-skills/blob/main/plugins/agentic-awesome-skills-claude/skills/k6-load-testing/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Mô phỏng 100 người dùng truy cập trang chủ của tôi trong 5 phút và cho tôi biết nó có bị sập không.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Công cụ tạo các kịch bản mô phỏng hành vi người dùng thật khi truy cập hệ thống của bạn. Nó đo thời gian phản hồi và tỷ lệ lỗi, rồi trình bày một báo cáo.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

k6 Load Testing

Detailed Guide

Read the detailed guide before executing this skill. It retains the complete procedure and reference material. Treat its safety, prerequisites, and validation requirements as mandatory. For focused work, load the relevant sections; for end-to-end work, read the guide completely.

When to Use This Skill

  • Use when you need to load test HTTP APIs, WebSocket endpoints, or browser scenarios
  • Use when setting up performance regression tests in CI/CD
  • Use when analyzing system behavior under various load conditions
  • Use when comparing performance between code changes
  • Use when validating SLA requirements and performance budgets

Examples

Example 1: Basic API Load Test

import http from 'k6/http';
import { check, sleep } from 'k6';

export const options = {
  vus: 50,
  duration: '2m',
  thresholds: {
    http_req_duration: ['p(95)<500'],
    http_req_failed: ['rate<0.01'],
  },
};

export default function () {
  const res = http.get('https://api.example.com/users');
  
  check(res, {
    'status is 200': (r) => r.status === 200,
    'response time < 500ms': (r) => r.timings.duration < 500,
  });
  
  sleep(1);
}

Example 2: Test with Authentication and Data Parameterization

import http from 'k6/http';
import { check } from 'k6';
import { SharedArray } from 'k6/data';

const users = new SharedArray('users', function () {
  return JSON.parse(open('./users.json'));
});

export default function () {
  const user = users[__VU % users.length];
  
  const loginRes = http.post('https://api.example.com/login',
    JSON.stringify({ email: user.email, password: user.password })
  );
  
  const token = loginRes.json('access_token');
  
  const headers = { 'Authorization': `Bearer ${token}` };
  const res = http.get('https://api.example.com/profile', { headers });
  
  check(res, { 'profile loaded': (r) => r.status === 200 });
}

Limitations

  • Use this skill only when the task clearly matches the scope described above.
  • Do not treat the output as a substitute for environment-specific validation, testing, or expert review.
  • Stop and ask for clarification if required inputs, permissions, safety boundaries, or success criteria are missing.
Câu hỏi thường gặp

“Load testing” là gì?

Đó là kiểm thử để xem một hệ thống (như website) hoạt động tốt đến đâu khi nhiều người cùng sử dụng.

k6 dùng để làm gì?

k6 là công cụ chuyên dụng để chạy các kiểm thử tải này một cách hiệu quả và tự động.

Tôi có cần biết lập trình để dùng không?

Hiểu biết cơ bản về lập trình được khuyến nghị khi thiết lập kiểm thử, nhưng công cụ có thể giúp tạo các script đơn giản.

Chi tiết

Mô tả gốc của tác giả

Comprehensive k6 load testing skill for API, browser, and scalability testing. Write realistic load scenarios, analyze results, and integrate with CI/CD.

repo: sickn33/agentic-awesome-skills

Độ phổ biến

Sao GitHub
48k
Vị trí xếp hạng
#5002
Giấy phép
MIT
Cập nhật
15/10/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự