Add logs to benchmark

pull/239/head
Thomas 3 years ago
parent 7ac7442f73
commit 24dc312367

@ -167,11 +167,15 @@ export class PortfolioCalculator {
timelinePeriodPromises.push(this.getTimePeriodForDate(j, currentDate));
}
const timelinePeriod: TimelinePeriod[] = await Promise.all(
console.time('calculate-timeline-periods');
const timelinePeriods: TimelinePeriod[] = await Promise.all(
timelinePeriodPromises
);
return timelinePeriod;
console.timeEnd('calculate-timeline-periods');
return timelinePeriods;
}
private async getTimePeriodForDate(j: number, currentDate: Date) {

@ -90,6 +90,8 @@ export class PortfolioController {
@Query('range') range,
@Res() res: Response
): Promise<HistoricalDataItem[]> {
console.time('get-chart-request');
let chartData = await this.portfolioService.getChart(
impersonationId,
range
@ -130,6 +132,8 @@ export class PortfolioController {
});
}
console.timeEnd('get-chart-request');
return <any>res.json(chartData);
}

Loading…
Cancel
Save