โ† Back to 30-Day Challenge

๐Ÿš€ Advanced & Capstone ยท Days 25โ€“30

Day 25: Performance in CI/CD

Objective

Wire a smoke load test into a pipeline with pass/fail thresholds.

Scenario

Add a lightweight load test (e.g., 10 users, 2 minutes) to your CI/CD pipeline. Set an assertion that p95 response time must stay under a threshold. Make it gate your deployment.

Metrics to Watch

threshold breachestrend vs baseline

When It Clicks

Small tests run often catch regressions cheaply.

Solution

In k6: add thresholds to the script - `thresholds: { 'http_req_duration{p95}': ['p(95)<500'], 'http_req_failed': ['rate<0.01'] }`. k6 exits with code 99 on threshold breach, which fails a CI step. In JMeter: run headless with `-n -t test.jmx -l results.jtl` and use the JMeter CI plugin or a post-step script that parses the JTL and exits non-zero if p95 exceeds your SLO. Set your threshold at 120% of your Day 2 baseline p95 - tight enough to catch regressions, loose enough to avoid false positives from environment noise.

Reflection

What threshold would you set so the gate is meaningful but not noisy?

Deliverable

A CI/CD pipeline config or script with a performance gate.

โš ๏ธ Never run load tests against infrastructure you do not own or have explicit written permission to test. Always use a dedicated test environment. Unauthorized load injection can cause outages, trigger legal liability, and violate terms of service.