simple.js 375 B

12345678910111213141516
  1. import http from 'k6/http';
  2. import { check, sleep } from 'k6';
  3. export const options = {
  4. stages: [
  5. { duration: '30s', target: 20 },
  6. { duration: '1m', target: 10 },
  7. { duration: '20s', target: 0 },
  8. ],
  9. };
  10. export default function () {
  11. const res = http.get('http://localhost:8080/echo');
  12. check(res, { 'status was 200': (r) => r.status == 200 });
  13. sleep(1);
  14. }