Remove markets
This commit is contained in:
+4
-1
@@ -1,3 +1,5 @@
|
||||
export {};
|
||||
|
||||
// Opt-in loopback-only, read-only smoke load. Not a production capacity certification.
|
||||
const args=process.argv.slice(2);
|
||||
const argument=(key:string,fallback:string)=>{const i=args.indexOf(key);return i<0?fallback:args[i+1];};
|
||||
@@ -12,7 +14,8 @@ const started=performance.now();
|
||||
await Promise.all(Array.from({length:concurrency},async()=>{
|
||||
while(next<count){const i=next++,start=performance.now();
|
||||
try{
|
||||
const response=await fetch(new URL(i%3===0?'/api/market':'/api/summary',endpoint),{redirect:'error',signal:AbortSignal.timeout(5000)});
|
||||
const path=i%3===0?'/api/peers':'/api/summary';
|
||||
const response=await fetch(new URL(path,endpoint),{redirect:'error',signal:AbortSignal.timeout(5000)});
|
||||
const reader=response.body?.getReader();let bytes=0;
|
||||
if(reader)try{for(;;){const part=await reader.read();if(part.done)break;bytes+=part.value.byteLength;if(bytes>2*1024*1024)throw new Error('Response too large');}}finally{await reader.cancel();reader.releaseLock();}
|
||||
totalBytes+=bytes;statuses[response.status]=(statuses[response.status]??0)+1;
|
||||
|
||||
Reference in New Issue
Block a user