Files
Backend_Assignment1/k6/smoke.js
T

24 lines
482 B
JavaScript

import http from 'k6/http';
import { check, sleep } from 'k6';
export const options = {
vus: 1,
iterations: 10,
thresholds: {
http_req_failed: ['rate<0.01'],
http_req_duration: ['p(95)<500'],
},
};
export default function () {
const response = http.get('http://app:3000/users/');
check(response, {
'status is 200': (r) => r.status === 200,
'response is JSON': (r) =>
r.headers['Content-Type']?.includes('application/json'),
});
sleep(1);
}