aded k6 and script and updated code with better logic and indexing on schema
This commit is contained in:
+23
@@ -0,0 +1,23 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user