Analiza trendów i baseline w CI
Śledź wydajność w czasie między kolejnymi uruchomieniami potoku, przechowując wartości bazowe i automatycznie wykrywając regresje, zanim trafią na produkcję.
Analiza trendów i baseline w CI to bezpłatna lekcja Load Testing & Performance Benchmarking (JMeter & k6) na CoddyKit. To lekcja 4 z 4. Możesz przeczytać całą lekcję poniżej za darmo — a potem ćwiczyć ją interaktywnie w przeglądarce z wbudowanym edytorem kodu i tutorem AI dostępnym 24/7. To część ścieżki edukacyjnej Load Testing & Performance Benchmarking (JMeter & k6), a Twój postęp synchronizuje się między webem a aplikacją CoddyKit. Kurs Load Testing & Performance Benchmarking (JMeter & k6) zawiera 4 lekcji w sumie.
Części tej lekcji nie zostały jeszcze przetłumaczone i są wyświetlane po angielsku.
A Single Run Is Not Enough
Pass/fail gates catch obvious breakage, but slow drift over weeks is invisible to a single run. Baselining compares each build against historical performance to catch creeping regressions.
What Is a Baseline?
A baseline is a stored reference result, usually the metrics from a known-good build. New runs are measured against it. Common baselines are the previous release or a rolling average of recent runs.
Tagging Runs for Trends
To compare across builds, tag each run with a unique identifier such as the commit SHA or build number. This lets the backend separate and chart each run.
k6 run --tag testid=$GIT_COMMIT --out influxdb=http://metrics:8086/k6 perf.jsStoring Results Over Time
Persist results in a time-series database (InfluxDB, Prometheus) or a results store. Without persistence there is no history to trend against.
Defining Acceptable Drift
Decide how much regression is tolerable, for example p95 may not exceed the baseline by more than 10%. Encode this as a comparison step in the pipeline.
BASELINE_P95=400
MAX_ALLOWED=$((BASELINE_P95 * 110 / 100))
echo "Threshold: $MAX_ALLOWED ms"Comparing Against Baseline
A small script can read the new p95 from the k6 JSON summary and fail the build if it exceeds the allowed drift.
P95=$(jq '.metrics.http_req_duration.values["p(95)"]' summary.json)
if (( $(echo "$P95 > $MAX_ALLOWED" | bc -l) )); then
echo 'Regression detected'
exit 1
fiRolling Baselines
Instead of one fixed reference, a rolling baseline averages the last N runs. This adapts to gradual, intentional changes while still flagging sudden regressions.
Visualizing Trends
A Grafana panel of p95 over build numbers makes drift obvious to the whole team. A slowly rising line is a warning even when every individual build passed its gate.
Avoiding Noisy Baselines
Run performance tests on consistent, isolated infrastructure. Comparing against a baseline collected on noisy shared hardware produces false regressions and erodes trust.
Updating the Baseline
When a release intentionally changes performance, promote its result to the new baseline. Automate this so the reference stays current without manual edits.
Annotating Releases
Mark deploys and config changes on your trend charts. An annotation at the exact build where p95 jumped turns a mysterious line into an obvious culprit.
Quick Check
Test your trend-analysis knowledge.
Recap
You learned to trend performance in CI.
- Tag and persist every run for history.
- Define acceptable drift and compare new runs to a baseline.
- Use rolling baselines and clean infrastructure to avoid noise.
Często zadawane pytania
Czy lekcja „Analiza trendów i baseline w CI” jest bezpłatna?
Tak — pełny tekst „Analiza trendów i baseline w CI” jest dostępny za darmo tutaj w sieci. Aby ćwiczyć ją interaktywnie (wbudowany edytor kodu i tutor AI dostępny 24/7) i odblokować resztę kursu Load Testing & Performance Benchmarking (JMeter & k6), przejdź na CoddyKit PRO. Kurs Load Testing & Performance Benchmarking (JMeter & k6) zawiera 4 lekcji w sumie.
Co nauczysz się w „Analiza trendów i baseline w CI”?
Śledź wydajność w czasie między kolejnymi uruchomieniami potoku, przechowując wartości bazowe i automatycznie wykrywając regresje, zanim trafią na produkcję. Ćwiczysz Load Testing & Performance Benchmarking (JMeter & k6) z praktycznym kodem, który uruchamiasz bezpośrednio w przeglądarce, a tutor AI dostępny 24/7 odpowiada na Twoje pytania podczas pracy nad lekcją.
Czy potrzebuję doświadczenia, aby zacząć Load Testing & Performance Benchmarking (JMeter & k6)?
Nie wymagamy żadnego doświadczenia. Load Testing & Performance Benchmarking (JMeter & k6) w CoddyKit jest strukturyzowany dla początkujących i zaawansowanych użytkowników, więc możesz zacząć tutaj lub od początku i uczyć się w swoim tempie. To lekcja 4 z 4.
Ile czasu zajmuje lekcja „Analiza trendów i baseline w CI”?
Większość lekcji CoddyKit trwa około 5–10 minut. Każda lekcja to mały, interaktywny krok, dzięki czemu robisz systematyczne postępy i zawsze wracasz dokładnie do tego samego miejsca — na webie i w aplikacji.
Czy mogę pisać i uruchamiać kod w tej lekcji Load Testing & Performance Benchmarking (JMeter & k6)?
Tak. Każda lekcja Load Testing & Performance Benchmarking (JMeter & k6) zawiera wbudowany edytor kodu, więc piszesz i uruchamiasz prawdziwy kod bezpośrednio w przeglądarce i od razu otrzymujesz sprzężenie zwrotne od AI — bez konfiguracji na komputerze.
Wszystkie lekcje w tym kursie
- Integracja JMeter z Jenkins
- k6 w GitHub Actions
- Bramki wydajnościowe i SLO
- Analiza trendów i baseline w CI