Skip to main content
AIDevOps
  • Learn
  • Learning Paths
  • Practice
  • Open Source
  • Books
  • Engineering

    AI DevOpsThe full map of building and operating AI servicesLLMOpsLLM deployment · evaluation · observabilityHands-on ProjectsBuild AI Agent projects

    Knowledge

    DocsTechnical documentationBlogEngineering articlesPloggerDevelopment log feed

    Validate

    Certification3-level skills certification · coming soon
AI Models
LlamaTutorial|MistralTutorial|GemmaTutorial|DeepSeekTutorial|QwenTutorial
🧪 Testing
k6JMeternGrinder
🤖 AI Applied Development
Applied AI Intro & RoadmapHugging FaceLangChainLlamaIndexLLMOps|LangGraphMCPMulti-AgentAgent Evaluation
🧠 AI Core
AI Intro & RoadmapML FundamentalsLLM Fundamentals|Python AIC++|PyTorchTensorFlowJAX
🧠 AI Agent Development
Finance AI AgentLLM API ServerStock Investing AgentAIOps AI AgentEducation AI AgentCoding AI Agent
🌱 Spring Cloud
Spring Intro & RoadmapSpring Cloud GatewaySpring BootJava|Spring AISpring SecuritySpring BatchSpring JPA
🐳 DevOps
DevOps Intro & RoadmapLinuxDockerCI/CD|Kubernetes BasicsK8s AdvancedPrometheusGrafana
🧱 Infrastructure
Infrastructure Intro & RoadmapNginxRedis
☁️ Cloud
Cloud Intro & RoadmapAWSGCPAzureNCPCloudflare
🎨 Frontend
Frontend Intro & RoadmapJavaScriptTypeScript|ReactNext.js|VueNuxt|Electron
📱 Mobile
Mobile Intro & RoadmapKotlinAndroidFlutter
⚙️ Backend
Backend Intro & RoadmapPython BasicsFastAPIDjangoFlask|CGoGinNode.js
💾 Database
DB Intro & RoadmapCore SQLOracleMySQLPostgreSQL|MongoDBVector DB
AIDevOps

Engineering AI. From Code to Production.
An engineering learning platform for building and operating AI and AI Agents

Learn

  • All Guides
  • Learning Paths
  • AI Tutorial
  • Practice
  • Books

Resources

  • AI DevOps
  • LLMOps
  • Hands-on Projects
  • Docs
  • Blog
  • Plogger
  • Open Source
  • Certification (coming soon)

Start Here

  • AI Core Roadmap
  • AI Applied Development Roadmap
  • Spring Cloud Roadmap
  • DevOps Roadmap
  • Infrastructure Roadmap

 

  • Cloud Roadmap
  • Frontend Roadmap
  • Mobile Roadmap
  • Backend Roadmap
  • Database Roadmap
© 2026 AIDevOps. All rights reserved.
Terms of ServicePrivacy PolicySitemaptestforge.kr
k6 · Practical Examples

⚡ k6 Practical Examples

Visitors

Copy-and-run k6 example code. Get started quickly with real-world flows, from Load, Stress, and Spike scenarios to CI/CD automation.

← Back to the k6 guide
⚡

Contents

0 / 4
  1. Environment setup
  2. Load scenario
  3. Thresholds & Checks
  4. GitHub Actions CI/CD
Contents 4 sections
  1. Environment setup
  2. Load scenario
  3. Thresholds & Checks
  4. GitHub Actions CI/CD
💡

Main run command: k6 run script.js

Environment setup

After installing k6, move the target URL into an environment variable.

BASH
export BASE_URL=https://staging.example.com
k6 version

Load scenario

Ramp up to the expected everyday traffic in stages and hold it.

JAVASCRIPT
export const options = { stages: [{ duration: '2m', target: 50 }, { duration: '5m', target: 50 }, { duration: '1m', target: 0 }] };

Thresholds & Checks

Use response time and failure rate as the CI pass criteria.

JAVASCRIPT
thresholds: { http_req_duration: ['p(95)<500'], http_req_failed: ['rate<0.01'] }

GitHub Actions CI/CD

Check for performance regressions on every PR and keep the results as artifacts.

BASH
npm install -g k6
k6 run --out json=results.json tests/load.js

Next steps

When adapting an example to a real service, first separate out the URL, credentials, thresholds, and report output location.

Go to the guide →