forked from grafana/k6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlocalhost.js
35 lines (33 loc) · 844 Bytes
/
localhost.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { group, check } from "k6";
import http from "k6/http";
export let options = {
thresholds: {
'http_req_duration{kind:html}': ["avg<=10"],
'http_req_duration{kind:css}': ["avg<=10"],
'http_req_duration{kind:img}': ["avg<=100"],
'http_reqs': ["rate>100"],
}
};
export default function() {
group("front page", function() {
check(http.get("http://localhost:8080/", {
tags: {'kind': 'html' },
}), {
"status is 200": (res) => res.status === 200,
});
});
group("stylesheet", function() {
check(http.get("http://localhost:8080/style.css", {
tags: {'kind': 'css' },
}), {
"status is 200": (res) => res.status === 200,
});
});
group("image", function() {
check(http.get("http://localhost:8080/teddy.jpg", {
tags: {'kind': 'img' },
}), {
"status is 200": (res) => res.status === 200,
});
});
}