Load Testing & Performance Benchmarking (JMeter & k6) · บทเรียน

การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI

ติดตามประสิทธิภาพตามเวลาระหว่างการทำงานของไปป์ไลน์ โดยจัดเก็บค่าฐานและตรวจจับการถดถอยโดยอัตโนมัติก่อนนำการเปลี่ยนแปลงออกใช้งาน

บทเรียน 4 จาก 413 ขั้นตอน

การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI เป็นบทเรียน Load Testing & Performance Benchmarking (JMeter & k6) ฟรีบน CoddyKit นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน คุณสามารถอ่านบทเรียนทั้งหมดด้านล่างฟรี — จากนั้นลองปฏิบัติด้วยตัวคุณเองในเบราว์เซอร์พร้อมตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7 บทเรียนนี้เป็นส่วนหนึ่งของเส้นทางการเรียน Load Testing & Performance Benchmarking (JMeter & k6) และความก้าวหน้าของคุณจะซิงค์ข้ามเว็บและแอป CoddyKit คอร์ส Load Testing & Performance Benchmarking (JMeter & k6) มีบทเรียนทั้งหมด 4 บทเรียน

บางส่วนของบทเรียนนี้ยังไม่ได้รับการแปล และแสดงเป็นภาษาอังกฤษ

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.js

Storing 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
fi

Rolling 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.
เริ่มต้นได้ฟรี

เรียนรู้ Load Testing & Performance Benchmarking (JMeter & k6) ด้วย AI tutor — ฟรี

เขียนและเรียกใช้โค้ดจริงในเบราว์เซอร์ของคุณ รับความช่วยเหลือทันทีจาก AI tutor 24/7 และเรียนรู้ต่อจากที่คุณหยุดบนเว็บหรือในแอป

คอร์ส
12
บทเรียน
48

คำถามที่พบบ่อย

บทเรียน “การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI” ฟรีหรือไม่

ใช่ — ข้อความเต็มของ “การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI” ฟรีให้อ่านที่นี่บนเว็บ เพื่อปฏิบัติแบบโต้ตอบ (ตัวแก้ไขโค้ดในตัวและติวเตอร์ AI ตลอด 24/7) และปลดล็อคส่วนที่เหลือของคอร์ส Load Testing & Performance Benchmarking (JMeter & k6) ให้อัปเกรดเป็น CoddyKit PRO คอร์ส Load Testing & Performance Benchmarking (JMeter & k6) มีบทเรียนทั้งหมด 4 บทเรียน

คุณจะเรียนรู้อะไรในบทเรียน “การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI”

ติดตามประสิทธิภาพตามเวลาระหว่างการทำงานของไปป์ไลน์ โดยจัดเก็บค่าฐานและตรวจจับการถดถอยโดยอัตโนมัติก่อนนำการเปลี่ยนแปลงออกใช้งาน คุณปฏิบัติ Load Testing & Performance Benchmarking (JMeter & k6) ด้วยโค้ดที่ใช้งานได้จริงที่คุณเรียกใช้โดยตรงในเบราว์เซอร์ และติวเตอร์ AI ตลอด 24/7 ตอบคำถามของคุณขณะที่คุณไปผ่านบทเรียน

คุณต้องมีประสบการณ์ก่อนที่จะเริ่มเรียน Load Testing & Performance Benchmarking (JMeter & k6) หรือไม่

ไม่จำเป็นต้องมีประสบการณ์มาก่อน Load Testing & Performance Benchmarking (JMeter & k6) บน CoddyKit ออกแบบมาสำหรับผู้เริ่มต้นไปจนถึงผู้เรียนขั้นสูง คุณสามารถเริ่มต้นที่นี่หรือเริ่มจากตัวแรกและเรียนด้วยความเร็วของคุณเอง นี่คือบทเรียนที่ 4 จากทั้งหมด 4 บทเรียน

บทเรียน “การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI” ใช้เวลานานแค่ไหน

บทเรียน CoddyKit ส่วนใหญ่ใช้เวลาประมาณ 5–10 นาที แต่ละบทเรียนจึงสั้นและเป็นแบบโต้ตอบ คุณสามารถก้าวหน้าอย่างต่อเนื่องและกลับมาเรียนต่อจากตรงที่เพิ่งหยุดบนเว็บและแอปได้เลย

ฉันเขียนและรันโค้ดในบทเรียน Load Testing & Performance Benchmarking (JMeter & k6) นี้ได้ไหม

ได้ บทเรียน Load Testing & Performance Benchmarking (JMeter & k6) ทุกบทมีตัวแก้ไขโค้ดในตัว คุณจึงเขียนและรันโค้ดจริงได้เลยในเบราว์เซอร์ และได้รับข้อเสนอแนะจาก AI ในทันที — ไม่ต้องติดตั้งในเครื่องของคุณ

บทเรียนทั้งหมดในหลักสูตรนี้

  1. การผสาน JMeter กับ Jenkins
  2. k6 ใน GitHub Actions
  3. ด่านประสิทธิภาพและ SLOs
  4. การวิเคราะห์แนวโน้มและการสร้างค่าฐานใน CI
← กลับไปที่ Load Testing & Performance Benchmarking (JMeter & k6)