Add logs to benchmark
This commit is contained in:
parent
7ac7442f73
commit
24dc312367
@ -167,11 +167,15 @@ export class PortfolioCalculator {
|
|||||||
timelinePeriodPromises.push(this.getTimePeriodForDate(j, currentDate));
|
timelinePeriodPromises.push(this.getTimePeriodForDate(j, currentDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
const timelinePeriod: TimelinePeriod[] = await Promise.all(
|
console.time('calculate-timeline-periods');
|
||||||
|
|
||||||
|
const timelinePeriods: TimelinePeriod[] = await Promise.all(
|
||||||
timelinePeriodPromises
|
timelinePeriodPromises
|
||||||
);
|
);
|
||||||
|
|
||||||
return timelinePeriod;
|
console.timeEnd('calculate-timeline-periods');
|
||||||
|
|
||||||
|
return timelinePeriods;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async getTimePeriodForDate(j: number, currentDate: Date) {
|
private async getTimePeriodForDate(j: number, currentDate: Date) {
|
||||||
|
@ -90,6 +90,8 @@ export class PortfolioController {
|
|||||||
@Query('range') range,
|
@Query('range') range,
|
||||||
@Res() res: Response
|
@Res() res: Response
|
||||||
): Promise<HistoricalDataItem[]> {
|
): Promise<HistoricalDataItem[]> {
|
||||||
|
console.time('get-chart-request');
|
||||||
|
|
||||||
let chartData = await this.portfolioService.getChart(
|
let chartData = await this.portfolioService.getChart(
|
||||||
impersonationId,
|
impersonationId,
|
||||||
range
|
range
|
||||||
@ -130,6 +132,8 @@ export class PortfolioController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
console.timeEnd('get-chart-request');
|
||||||
|
|
||||||
return <any>res.json(chartData);
|
return <any>res.json(chartData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user