Skip to content

Commit

Permalink
add chain logging to zap timings
Browse files Browse the repository at this point in the history
  • Loading branch information
seguido committed Jul 18, 2024
1 parent ac531f9 commit 6f0e926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/api/zap/proxy/kyber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const getProxiedQuote = async (
};

export async function proxyKyberSwap(ctx: Koa.Context) {
console.log('proxyKyberSwap...');
const start = Date.now();
const chain = ctx.params.chainId;
console.log('proxyKyberSwap... ' + chain);
const requestObject: SwapRequest = ctx.request['body'] as any; // koa-bodyparser adds parsed json to body
const proxiedSwap = await postProxiedSwap(requestObject, chain);
console.log(`proxyKyberSwap took ${(Date.now() - start) / 1000}s`);
Expand All @@ -49,9 +49,9 @@ export async function proxyKyberSwap(ctx: Koa.Context) {
}

export async function proxyKyberQuote(ctx: Koa.Context) {
console.log('proxyKyberQuote...');
const start = Date.now();
const chain = ctx.params.chainId;
console.log('proxyKyberQuote... ' + chain);
const requestObject: QuoteRequest = ctx.query as any;
const proxiedQuote = await getProxiedQuote(requestObject, chain);
console.log(`proxyKyberQuote took ${(Date.now() - start) / 1000}s`);
Expand Down
4 changes: 2 additions & 2 deletions src/api/zap/proxy/one-inch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ const getProxiedQuote = async (
};

export async function proxyOneInchSwap(ctx: Koa.Context) {
console.log('proxyOneInchSwap...');
const start = Date.now();
const chain = ctx.params.chainId;
console.log('proxyOneInchSwap... ' + chain);
const requestObject: SwapRequest = ctx.query as any;
const proxiedSwap = await getProxiedSwap(requestObject, chain);
console.log(`proxyOneInchSwap took ${(Date.now() - start) / 1000}s`);
Expand All @@ -49,9 +49,9 @@ export async function proxyOneInchSwap(ctx: Koa.Context) {
}

export async function proxyOneInchQuote(ctx: Koa.Context) {
console.log('proxyOneInchQuote...');
const start = Date.now();
const chain = ctx.params.chainId;
console.log('proxyOneInchQuote... ' + chain);
const requestObject: QuoteRequest = ctx.query as any;
const proxiedQuote = await getProxiedQuote(requestObject, chain);
console.log(`proxyOneInchQuote took ${(Date.now() - start) / 1000}s`);
Expand Down

0 comments on commit 6f0e926

Please sign in to comment.