Skip to content

Instantly share code, notes, and snippets.

@cuongld2
Created November 27, 2020 03:37
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 cuongld2/7376707a104dcbfa4744be97af61e6b5 to your computer and use it in GitHub Desktop.
Save cuongld2/7376707a104dcbfa4744be97af61e6b5 to your computer and use it in GitHub Desktop.
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