Last active
December 19, 2023 11:06
-
-
Save leandroandrade/86cc384020997ea2441a1e6579ea7684 to your computer and use it in GitHub Desktop.
This file contains 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 {sleep} from 'k6'; | |
export let options = { | |
insecureSkipTLSVerify: true, | |
noConnectionReuse: false, | |
stages: [ | |
{ duration: '1m', target: 10 }, | |
{ duration: '2m', target: 20 }, | |
{ duration: '1m', target: 0 }, | |
] | |
} | |
export default function () { | |
const payload = JSON.stringify({ | |
name: `User ${Math.random()}`, | |
email: `email${Math.random()}@exemplo.com`, | |
password: `password${Math.random()}`, | |
}); | |
const params = { | |
headers: { | |
'Content-Type': 'application/json', | |
}, | |
}; | |
http.batch(['POST', 'http://localhost:8080/', payload, params]); | |
sleep(1); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment