Skip to content

Instantly share code, notes, and snippets.

@misTrasteos
Created November 22, 2021 15:19
Show Gist options
  • Save misTrasteos/498117676dc4ac19ae064e588a817fc1 to your computer and use it in GitHub Desktop.
Save misTrasteos/498117676dc4ac19ae064e588a817fc1 to your computer and use it in GitHub Desktop.
K6 basic example
import http from 'k6/http';
import { randomString } from 'https://jslib.k6.io/k6-utils/1.1.0/index.js';
export const options = {
stages: [
{ duration: '30s', target: 500 },
{ duration: '2m', target: 1000 },
{ duration: '30s', target: 0 }
]
};
export const params = {
headers: {
'Content-Type': 'application/json'
},
tags: {
ktest: 'yes'
}
};
export function setup(){
return {};
}//setup
export function teardown(data){
}//teardown
export default function () {
// replace the url
http.get('http://jbang-service:8080/hi/'+ randomString(10));
}//default
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment