Skip to content

Instantly share code, notes, and snippets.

@enigmatikme
Last active October 7, 2018 23:23
Show Gist options
  • Save enigmatikme/63eb3d683f3ea5a70c86d11dc2317189 to your computer and use it in GitHub Desktop.
Save enigmatikme/63eb3d683f3ea5a70c86d11dc2317189 to your computer and use it in GitHub Desktop.
import http from 'k6/http';
import { check, sleep } from 'k6';
//If you want to avoid having to type --vus 10 and --duration 30s
export let options = {
vus: 500,
rps: 2000,
duration: '1m'
};
export default function() {
var num = Math.floor(Math.random() * Math.floor(100));
let res = http.get(`http://localhost:3003/artist/${num}`);
check(res, {
'status was 200': (r) => r.status === 200,
'transaction time OK': (r) => r.timings.duration < 500
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment