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

Install the plugin

npm install artillery-plugin-metrics-by-endpoint

Enable the plugin

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

Configuration

useRequestNamesOnly

Set useRequestNamesOnly 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://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: "/?one"
name: index
- get:
url: "/?two"
name: index
- get:
url: "/?three"
name: index
- get:
url: "/docs"

Sample output:

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