Log batch time in mass scan script
This commit is contained in:
parent
e9914e317b
commit
2905884c02
@ -1,9 +1,10 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
async function main() {
|
async function main() {
|
||||||
|
console.time("batches")
|
||||||
for (let i = 0; i < 100; i++) {
|
for (let i = 0; i < 100; i++) {
|
||||||
const batch = [];
|
const batch = [];
|
||||||
for (let i = 0; i < 20; i++) {
|
for (let i = 0; i < 6; i++) {
|
||||||
batch.push(axios.post('http://localhost:4010/api/scans/trackscans', { card: 200000000001, station: 2 }, {
|
batch.push(axios.post('http://localhost:4010/api/scans/trackscans', { card: 200000000001, station: 2 }, {
|
||||||
headers: {
|
headers: {
|
||||||
Authorization: 'Bearer 10F2E64.BB4F6CC5-2148-4CCF-88B5-0AA85D0508A9'
|
Authorization: 'Bearer 10F2E64.BB4F6CC5-2148-4CCF-88B5-0AA85D0508A9'
|
||||||
@ -11,7 +12,8 @@ async function main() {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
await Promise.all(batch)
|
await Promise.all(batch)
|
||||||
console.log(`Finished batch ${i}`)
|
console.timeLog("batches", `Finished batch ${i}`)
|
||||||
}
|
}
|
||||||
|
console.timeEnd("batches")
|
||||||
}
|
}
|
||||||
main();
|
main();
|
Loading…
x
Reference in New Issue
Block a user