-
Notifications
You must be signed in to change notification settings - Fork 136
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* k6 example perf test * k6 example perf test * k6 perf test - additinal requests * k6 perf test - additinal requests removed * k6 perf - workflows, values (prometheus + grafana) * branch updated * k6 workflow with prometheus - native histogram, K6_PROMETHEUS_RW_TREND_STATS * k6 test updated * k6 perf - prometheus values - native-histograms enabled
- Loading branch information
1 parent
6b5a087
commit 6276c1c
Showing
4 changed files
with
2,840 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
# Simple | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: k6-perf-test | ||
spec: | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: main | ||
paths: | ||
- test/k6/executor-tests/k6-perf-test.js | ||
container: | ||
# resources: | ||
# requests: | ||
# cpu: 128m | ||
# memory: 128Mi | ||
workingDir: /data/repo/test/k6/executor-tests | ||
config: | ||
vus: {type: integer, default: 20} | ||
duration: {type: string, default: '1m'} | ||
steps: | ||
- name: Run test | ||
container: | ||
image: grafana/k6:0.49.0 | ||
steps: | ||
- run: | ||
shell: mkdir /data/artifacts && k6 run k6-perf-test.js --vus {{ config.vus }} --duration {{ config.duration }} | ||
env: | ||
- name: K6_WEB_DASHBOARD | ||
value: "true" | ||
- name: K6_WEB_DASHBOARD_EXPORT | ||
value: "/data/artifacts/k6-test-report.html" | ||
steps: | ||
- name: Saving artifacts | ||
workingDir: /data/artifacts | ||
artifacts: | ||
paths: | ||
- '*' | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: k6-perf-test-workers | ||
spec: | ||
config: | ||
vus: {type: integer, default: 20} | ||
duration: {type: string, default: '1m'} | ||
workers: {type: integer, default: 3} | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: main | ||
paths: | ||
- test/k6/executor-tests/k6-perf-test.js | ||
steps: | ||
- name: Run test | ||
parallel: | ||
count: 'config.workers' | ||
transfer: | ||
- from: /data/repo | ||
fetch: | ||
- from: /data/artifacts | ||
use: | ||
- name: distribute/evenly | ||
# container: | ||
# resources: | ||
# requests: | ||
# cpu: 128m | ||
# memory: 128Mi | ||
paused: true # synchronise running all workers | ||
run: | ||
image: grafana/k6:0.49.0 | ||
workingDir: /data/repo/test/k6/executor-tests | ||
shell: mkdir /data/artifacts && k6 run k6-perf-test.js --vus {{ config.vus }} --duration {{ config.duration }} --execution-segment '{{ index }}/{{ count }}:{{ index + 1 }}/{{ count }}' | ||
env: | ||
- name: K6_WEB_DASHBOARD | ||
value: "true" | ||
- name: K6_WEB_DASHBOARD_EXPORT | ||
value: "/data/artifacts/k6-test-report-worker-{{ index + 1}}.html" | ||
artifacts: | ||
workingDir: /data/artifacts | ||
paths: | ||
- '*.html' | ||
--- | ||
apiVersion: testworkflows.testkube.io/v1 | ||
kind: TestWorkflow | ||
metadata: | ||
name: k6-perf-test-workers-prometheus | ||
spec: | ||
config: | ||
vus: {type: integer, default: 20} | ||
duration: {type: string, default: '1m'} | ||
workers: {type: integer, default: 3} | ||
content: | ||
git: | ||
uri: https://github.com/kubeshop/testkube | ||
revision: main | ||
paths: | ||
- test/k6/executor-tests/k6-perf-test.js | ||
steps: | ||
- name: Run test | ||
parallel: | ||
count: 'config.workers' | ||
transfer: | ||
- from: /data/repo | ||
fetch: | ||
- from: /data/artifacts | ||
use: | ||
- name: distribute/evenly | ||
# container: | ||
# resources: | ||
# requests: | ||
# cpu: 128m | ||
# memory: 128Mi | ||
paused: true # synchronise running all workers | ||
run: | ||
image: grafana/k6:0.49.0 | ||
workingDir: /data/repo/test/k6/executor-tests | ||
shell: mkdir /data/artifacts && k6 run k6-perf-test.js -o experimental-prometheus-rw --vus {{ config.vus }} --duration {{ config.duration }} --execution-segment '{{ index }}/{{ count }}:{{ index + 1 }}/{{ count }}' --tag testid=worker-{{ index + 1}} | ||
env: | ||
- name: K6_WEB_DASHBOARD | ||
value: "true" | ||
- name: K6_WEB_DASHBOARD_EXPORT | ||
value: "/data/artifacts/k6-test-report-worker-{{ index + 1}}.html" | ||
- name: K6_PROMETHEUS_RW_SERVER_URL | ||
value: 'http://prometheus-server.prometheus-grafana.svc.cluster.local:80/api/v1/write' | ||
- name: K6_PROMETHEUS_RW_TREND_STATS | ||
value: 'p(95),p(99),min,max' | ||
- name: K6_PROMETHEUS_RW_TREND_AS_NATIVE_HISTOGRAM | ||
value: "true" | ||
artifacts: | ||
workingDir: /data/artifacts | ||
paths: | ||
- '*.html' |
Oops, something went wrong.