reserve long polling longer, add withdrawOnly to bench1
This commit is contained in:
parent
72c6643969
commit
f8c814cf95
@ -52,6 +52,7 @@ export async function runBench1(configJson: any): Promise<void> {
|
|||||||
const numDeposits = b1conf.deposits ?? 5;
|
const numDeposits = b1conf.deposits ?? 5;
|
||||||
const restartWallet = b1conf.restartAfter ?? 20;
|
const restartWallet = b1conf.restartAfter ?? 20;
|
||||||
|
|
||||||
|
const withdrawOnly = b1conf.withdrawOnly ?? false;
|
||||||
const withdrawAmount = (numDeposits + 1) * 10;
|
const withdrawAmount = (numDeposits + 1) * 10;
|
||||||
|
|
||||||
logger.info(
|
logger.info(
|
||||||
@ -110,20 +111,22 @@ export async function runBench1(configJson: any): Promise<void> {
|
|||||||
`Finished withdrawal amount=${withdrawAmount} time=${Date.now() - start}`,
|
`Finished withdrawal amount=${withdrawAmount} time=${Date.now() - start}`,
|
||||||
);
|
);
|
||||||
|
|
||||||
for (let i = 0; i < numDeposits; i++) {
|
if (!withdrawOnly) {
|
||||||
logger.trace(`Starting deposit amount=10`);
|
for (let i = 0; i < numDeposits; i++) {
|
||||||
start = Date.now();
|
logger.trace(`Starting deposit amount=10`);
|
||||||
|
start = Date.now();
|
||||||
|
|
||||||
await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
|
await wallet.client.call(WalletApiOperation.CreateDepositGroup, {
|
||||||
amount: b1conf.currency + ":10",
|
amount: b1conf.currency + ":10",
|
||||||
depositPaytoUri: b1conf.payto,
|
depositPaytoUri: b1conf.payto,
|
||||||
});
|
});
|
||||||
|
|
||||||
await wallet.runTaskLoop({
|
await wallet.runTaskLoop({
|
||||||
stopWhenDone: true,
|
stopWhenDone: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
logger.info(`Finished deposit amount=10 time=${Date.now() - start}`);
|
logger.info(`Finished deposit amount=10 time=${Date.now() - start}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -165,6 +168,8 @@ interface Bench1Config {
|
|||||||
* Defaults to 20.
|
* Defaults to 20.
|
||||||
*/
|
*/
|
||||||
restartAfter?: number;
|
restartAfter?: number;
|
||||||
|
|
||||||
|
withdrawOnly?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -179,4 +184,5 @@ const codecForBench1Config = () =>
|
|||||||
.property("deposits", codecOptional(codecForNumber()))
|
.property("deposits", codecOptional(codecForNumber()))
|
||||||
.property("currency", codecForString())
|
.property("currency", codecForString())
|
||||||
.property("restartAfter", codecOptional(codecForNumber()))
|
.property("restartAfter", codecOptional(codecForNumber()))
|
||||||
|
.property("withdrawOnly", codecOptional(codecForBoolean())
|
||||||
.build("Bench1Config");
|
.build("Bench1Config");
|
||||||
|
@ -538,7 +538,7 @@ async function updateReserve(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const reserveUrl = new URL(`reserves/${reservePub}`, reserve.exchangeBaseUrl);
|
const reserveUrl = new URL(`reserves/${reservePub}`, reserve.exchangeBaseUrl);
|
||||||
reserveUrl.searchParams.set("timeout_ms", "1000");
|
reserveUrl.searchParams.set("timeout_ms", "30000");
|
||||||
|
|
||||||
const resp = await ws.http.get(reserveUrl.href, {
|
const resp = await ws.http.get(reserveUrl.href, {
|
||||||
timeout: getReserveRequestTimeout(reserve),
|
timeout: getReserveRequestTimeout(reserve),
|
||||||
|
Loading…
Reference in New Issue
Block a user