Skip to main content

Per-endpoint (URL) metrics

What you'll learn
  • How to make Artillery report response time metrics for individual endpoints / URLs

Overview

By default, Artilery calculates and prints response time metrics (p50, p95, p99, min and max) measured across all endpoints (or URLs). artillery-plugin-metrics-by-endpoint can be used to print response time metrics per URL.

Usage

Enable the plugin

config:
plugins:
metrics-by-endpoint: {}

Configuration

useOnlyRequestNames

Set useOnlyRequestNames to report metrics based on the name of the request, rather than the URL.

This can be useful when your test sends requests to the same endpoint with different query string parameters.

If the name property is not set on a request, the plugin will use the URL.

In the following example, metrics for the first 3 requests to / which share the same name (but use different query strings) will be reported together.

config:
target: https://www.artillery.io
phases:
- duration: 60
arrivalRate: 1
plugins:
metrics-by-endpoint:
# Group metrics by request name rather than URL:
useOnlyRequestNames: true
scenarios:
- flow:
- get:
url: "/docs/?one"
name: index
- get:
url: "/docs/?two"
name: index
- get:
url: "/docs/?three"
name: index

Sample output:

  index:
min: 30
max: 329
median: 47
p95: 318
p99: 329
code 200 on index: 30
code 200 on /docs: 10