Skip to content

Commit

Permalink
K6 test
Browse files Browse the repository at this point in the history
  • Loading branch information
msirovy committed May 27, 2023
1 parent 6c01266 commit 0d10a7e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
4 changes: 2 additions & 2 deletions deploy.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@ job "__JOB_NAME__" {
provider = "nomad"

tags = [
"webapp",
"public",
"traefik.enable=true",
"traefik.http.routers.${NOMAD_JOB_NAME}-app.rule=Host(`${var.fqdn}`)",
"traefik.http.routers.${NOMAD_JOB_NAME}-app.tls=true"
"traefik.http.routers.${NOMAD_JOB_NAME}-app.rule=Host(`${var.fqdn}`)"
]

port = "app"
Expand Down
22 changes: 22 additions & 0 deletions k6-troll.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import http from 'k6/http';
import { group, sleep } from 'k6';
export const options = {"stages":[{"duration":"300s","target":25},{"duration":"15s","target":0}],"thresholds":{"http_req_failed":["rate\u003c0.01"],"http_req_duration":["p(99) \u003c 1000"]}};
export default () => {

group("pomalu", (_) => {
http.get(`http://debug-troll.fejk.net/v1/pomalu/`, {"headers":{"X-Auth-Key":""}});

})

group("hodne-pomalu", (_) => {
http.get(`http://debug-troll.fejk.net/v1/hodne-pomalu/?wait=500`, {"headers":{"X-Auth-Key":""}}).json();
http.get(`http://debug-troll.fejk.net/v1/hodne-pomalu/?wait=10`, {"headers":{"X-Auth-Key":""}});
})


http.get(`http://debug-troll.fejk.net/v1/hodne-moc-pomalu/?wait=5000`, {"headers":{"X-Auth-Key":""}}).json();
http.get(`http://debug-troll.fejk.net/v1/hodne-moc-pomalu/?wait=1000`, {"headers":{"X-Auth-Key":""}});

sleep(0.1);
};

0 comments on commit 0d10a7e

Please sign in to comment.