Hi,
I’ve created dummy dataon a data base, and I’ve generated a file with a list of URLs (arounf 10 milliion).
To be honest all I needed from the file is the ID, and then I could use something like:
http.delete('http://something/pi/employee/'+ ID, null, params);
I’ve check this post: How to load test list of URLs but I don’t need to ramdominze, just share the list to all VUs and maybe use the iterration to get the index file. I’ve tryed this:
import exec from 'k6/execution';
import http from 'k6/http';
import { SharedArray } from 'k6/data';
import { sleep } from 'k6';
import papaparse from 'https://jslib.k6.io/papaparse/5.1.1/index.js';
export let options = {
insecureSkipTLSVerify: true,
noConnectionReuse: false,
stages: [
{ duration: "5m", target: 100 }, // simulate ramp-up of traffic from 1 to 100 users over 5 minutes
{ duration: "10m", target: 100 }, // stay at 100 users for 10 minutes
{ duration: "5m", target: 0 }, // ramp-down to 0 users
],
};
const sharedData = new SharedArray("URLs", function () {
let data = papaparse.parse(open('net.list'), { header: true }).data;
return data;
});
export default function () {
const params = {
headers: { 'Content-Type': 'application/json', },
};
const url = 'http://10.47.2.220/java/api/employee/' + data[exec.scenario.iterationInTest];
http.delete(url, null, params);
sleep(1);
}
But the K6 exists with Killed… Maybe the URLs file it too big, it’s 389M. The list:
root@openvpn:~/K6# head -n10 net.list
url
http://10.47.2.220/net/api/employee/44
http://10.47.2.220/net/api/employee/50
http://10.47.2.220/net/api/employee/56
http://10.47.2.220/net/api/employee/62
http://10.47.2.220/net/api/employee/68
http://10.47.2.220/net/api/employee/71
http://10.47.2.220/net/api/employee/74
http://10.47.2.220/net/api/employee/80
http://10.47.2.220/net/api/employee/83
Can anyone help me?
Thank you.