Last active
September 11, 2023 00:58
-
-
Save QAInsights/d856303859c4a4957ad6b74d6e9c25c2 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import http from 'k6/http'; | |
import { check } from 'k6'; | |
export const options = { | |
vus: 1, | |
duration: '300s', | |
noConnectionReuse: false, | |
batchPerHost: 20, | |
}; | |
export default function () { | |
// Define the number of parallel connections | |
const numConnections = 20; | |
const requests = []; | |
for (let i = 0; i < numConnections; i++) { | |
requests.push({ method: 'GET', url: 'http://{IP}' }); | |
} | |
const responses = http.batch(requests); | |
// Process the responses and perform checks as needed | |
responses.forEach((res) => { | |
check(res, { | |
'Status is 200': (r) => r.status === 200, | |
// Add more checks as needed | |
}); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment