How to use the k6/metrics.Trend function in k6

To help you get started, we’ve selected a few k6 examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kyma-project / kyma / tests / perf / components / serverless / perf-test-serverless.js View on Github external
import http from "k6/http"
import { check } from "k6"
import { Trend } from "k6/metrics"

var httpReqDurationNoFunc = new Trend("http_req_duration_no_func", true)
var httpReqWaitingNoFunc = new Trend("http_req_waiting_no_func", true)

export let options = {
  // unlimited
  rps: 0,
  tags: {
    "component": "serverless",
    "revision": `${__ENV.REVISION}`
  },
  // ramp up #virtual users (VU) over time to get maximum throughput
  stages: [
    { duration: "90s", target: 2 ** 3 },
    { duration: "90s", target: 2 ** 4 },
    { duration: "90s", target: 2 ** 5 },
  ],
}
github kyma-project / kyma / tests / perf / components / serverless / perf-test-serverless.js View on Github external
import http from "k6/http"
import { check } from "k6"
import { Trend } from "k6/metrics"

var httpReqDurationNoFunc = new Trend("http_req_duration_no_func", true)
var httpReqWaitingNoFunc = new Trend("http_req_waiting_no_func", true)

export let options = {
  // unlimited
  rps: 0,
  tags: {
    "component": "serverless",
    "revision": `${__ENV.REVISION}`
  },
  // ramp up #virtual users (VU) over time to get maximum throughput
  stages: [
    { duration: "90s", target: 2 ** 3 },
    { duration: "90s", target: 2 ** 4 },
    { duration: "90s", target: 2 ** 5 },
  ],
}