Skip to content

Instantly share code, notes, and snippets.

@cuongld2

cuongld2/k6.js

Created Nov 27, 2020
Embed
What would you like to do?
k6 test code
import http from 'k6/http';
import { sleep } from 'k6';
export let options = {
vus: 1000,
duration: '300s',
};
export default function () {
let host = 'example';
let payload = JSON.stringify({"query":"query ($filter: JSON) { population_var (accessibility: all, offset: 1, first: 20, filter: $filter) { variant_id hvgsg_id af ac an gq variant_caller dbsnp_id variant_class impact gene_symbol consequence num_het num_hom_alt num_hom_ref num_unknown subject_count } }","variables":{"filter": {"AND": []}}}
);
let params = {
headers: {
'Content-Type': 'application/json',
'Host':host,
'Content-Length':'330'
},
};
http.post('https://'+host+'/gas/graphql',payload,params);
sleep(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment