Add 99, 99.5 percentile stats to built-in HTTP trend metrics


#1

Hi, Can I add/remove statistics (for example add 99, 99.9 percentiles and remove min, max) to the built-in HTTP Trend metrics (for example http_req_duration) which I eventually want to push in the influxdb and see in the grafana dashboard?


#2

Hi,

k6 doesn’t send 99 percentile or min/max to influxdb or … anywhere really. It only sends values (+ timestamps, tags and other data to distinguish between data points).

The calculation of percentiles, min, max and so on in k6 is for the summary on the end and (more importantly) thresholds.
Grafana through influxdb has ways to than calculate min, max, percentiles and others from that data.

If what you want is to add additional metrics you can use custom metrics.


#3

Thanks @mstoykov, is there a way to customize built-in metrics (for example http_req_duration) to show additional percentile i.e. 99th and 99.9 in K6 run smmary output.


#4

@vishalcdac07, yes, you can use something like this to specify different summary trend statistics: k6 run --summary-trend-stats="min,med,avg,max,p(99),p(99.9),p(99.99)" script.js

You can also specify the same option via the K6_SUMMARY_TREND_STATS environment variable or via the summaryTrendStats exported script option, like this:

import http from 'k6/http';
import { sleep } from "k6";


export let options = {
    summaryTrendStats: ["med", "p(99)", "p(99.50)"],
};

export default function () {
    http.get("http://test.loadimpact.com");
    sleep(1);
}