Skip to content

Instantly share code, notes, and snippets.

@leandroandrade
Last active December 19, 2023 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leandroandrade/86cc384020997ea2441a1e6579ea7684 to your computer and use it in GitHub Desktop.
Save leandroandrade/86cc384020997ea2441a1e6579ea7684 to your computer and use it in GitHub Desktop.
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