Skip to content

Instantly share code, notes, and snippets.

@IamTechknow
Last active November 24, 2018 09:32
Show Gist options
  • Save IamTechknow/e7e25afe2ee2c820b09e3e7f289cbf15 to your computer and use it in GitHub Desktop.
Save IamTechknow/e7e25afe2ee2c820b09e3e7f289cbf15 to your computer and use it in GitHub Desktop.
Stress test of local service with K6
Testing code:
import http from "k6/http";
import { sleep } from "k6";
export let options = {
vus: 1000,
duration: "20s",
rps: 1000
};
export default function () {
http.get("http://localhost:3002/api/15000/stats");
sleep(1);
};
Results (Output appearance is due to the Windows 8.1 command prompt):
running [========================================================>-] 19.6s / 20
running [========================================================>-] 19.7s / 20
running [========================================================>-] 19.7s / 20
running [========================================================>-] 19.8s / 20
running [========================================================>-] 19.8s / 20
running [========================================================>-] 19.9s / 20
running [========================================================>-] 19.9s / 20
done [==========================================================] 20s / 20s
data_received..............: 9.8 MB 491 kB/s
data_sent..................: 1.7 MB 86 kB/s
http_req_blocked...........: avg=12.73µs min=0s med=0s max=22.01ms p(90)
=0s p(95)=0s
http_req_connecting........: avg=7.68µs min=0s med=0s max=22.01ms p(90)
=0s p(95)=0s
http_req_duration..........: avg=32.92ms min=0s med=1ms max=682.45ms p(90)
=10ms p(95)=318.21ms
http_req_receiving.........: avg=35.27µs min=0s med=0s max=5ms p(90)
=0s p(95)=0s
http_req_sending...........: avg=3.05µs min=0s med=0s max=4ms p(90)
=0s p(95)=0s
http_req_tls_handshaking...: avg=0s min=0s med=0s max=0s p(90)
=0s p(95)=0s
http_req_waiting...........: avg=32.89ms min=0s med=1ms max=682.45ms p(90)
=10ms p(95)=318.21ms
http_reqs..................: 19007 950.323942/s
iteration_duration.........: avg=1.08s min=1s med=1.02s max=2.52s p(90)
=1.07s p(95)=1.46s
iterations.................: 18014 900.675303/s
vus........................: 1000 min=1000 max=1000
vus_max....................: 1000 min=1000 max=1000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment