I was just trying load Testing with k6 for Google.com
import http from 'k6/http';
import { check } from 'k6';
export let options = {
stages: [
{ duration: '1m', target: 1500 }, // Ramp up to n virtual users over t minute
{ duration: '2m', target: 1500 }, // Stay at n virtual users for t minutes
{ duration: '1m', target: 0 }, // Ramp down to 0 virtual users over t minute
],
};
export default function () {
const res = http.get('https://www.google.com/');
console.log('Status code', res.status);
check(res, {
'is status 200': (r) => r.status === 200,
'Server error': (r) => r.status >= 500,
'Connection closed': (r) => r.status === 0,
'Any other success': (r) => r.status > 200 && r.status < 400,
});
}
Above is my script but for 1500 virtual users , i have the following errors output in my terminal
Status Code =0 , Request Failed error=“Get "https://www.google.com/\”: dial: i/o timeout"
And WARN[0013] Request Failed : unexpected EOF"
Please help me with this status code 0