0Pricing
Load Testing & Performance Benchmarking (JMeter & k6) · Lesson

Custom Metrics and Trends in k6

Define your own Counter, Gauge, Rate, and Trend metrics in k6 to measure exactly what matters for your advanced scenarios.

Beyond Built-in Metrics

k6 ships with built-in metrics like http_req_duration, but advanced tests often need to measure domain-specific values: items in a cart, business transaction time, or a custom error rate. k6 lets you create custom metrics.

The Four Metric Types

k6 offers four custom metric types from k6/metrics:

  • Counter — cumulative sum.
  • Gauge — last recorded value.
  • Rate — percentage of non-zero/true values.
  • Trend — statistics like min, max, avg, p95.

All lessons in this course

  1. Virtual User Scenarios (VUs)
  2. Data Parameterization in k6
  3. Cloud Execution with k6
  4. Custom Metrics and Trends in k6
← Back to Load Testing & Performance Benchmarking (JMeter & k6)