external-api-fast.js 806 B

1234567891011121314151617181920212223
  1. import http from 'k6/http';
  2. import { sleep } from 'k6';
  3. const ioLatencyMilliseconds = 40;
  4. const workIterations = 5000;
  5. const outputIterations = 10;
  6. export const options = {
  7. stages: [
  8. { duration: '20s', target: 50, }, // ramp up to concurrency 10 over 20s
  9. { duration: '20s', target: 200 }, // ramp up to concurrency 25 over 20s
  10. { duration: '20s', target: 0 }, // ramp down to 0 over 20s
  11. ],
  12. thresholds: {
  13. http_req_failed: ['rate<0.01'], // http errors should be less than 1%
  14. http_req_duration: ['p(90)<150'], // 90% of requests should be below 150ms
  15. },
  16. };
  17. export default function () {
  18. http.get(`${__ENV.CADDY_HOSTNAME}/sleep.php?sleep=${ioLatencyMilliseconds}&work=${workIterations}&output=${outputIterations}`);
  19. //sleep(1);
  20. }