diff --git a/server/app/Controllers/Http/SummonersController.ts b/server/app/Controllers/Http/SummonersController.ts index 5fdb6dc..3f6bf78 100644 --- a/server/app/Controllers/Http/SummonersController.ts +++ b/server/app/Controllers/Http/SummonersController.ts @@ -42,12 +42,16 @@ export default class SummonersController { finalJSON.seasons = [getCurrentSeason()] // CURRENT GAME + console.time('playing') const currentGame = await Jax.Spectator.summonerID(account.id, region) finalJSON.playing = !!currentGame finalJSON.current = currentGame + console.timeEnd('playing') // RANKED STATS + console.time('ranked') finalJSON.ranked = await SummonerService.getRanked(account.id, region) + console.timeEnd('ranked') // RECENT ACTIVITY finalJSON.recentActivity = await StatsService.getRecentActivity(account.puuid) diff --git a/server/app/Services/MatchService.ts b/server/app/Services/MatchService.ts index 670a12d..4173f78 100644 --- a/server/app/Services/MatchService.ts +++ b/server/app/Services/MatchService.ts @@ -21,6 +21,7 @@ class MatchService { let alreadyIn = false let index = 0 do { + console.log('--> CALL TO RIOT MATCHLIST') const newMatchList = await Jax.Matchlist.puuid(account.puuid, region, index) // Error while fetching Riot API if (!newMatchList) { @@ -49,6 +50,7 @@ class MatchService { const currentMatchList = await summonerDB.related('matchList').query().orderBy('matchId', 'asc') const currentMatchListIds = currentMatchList.map((m) => m.matchId) + console.time('RiotMatchList') const newMatchList = await this._fetchMatchListUntil( account, region, @@ -56,6 +58,7 @@ class MatchService { return currentMatchListIds.some((id) => id === newMatchList[newMatchList.length - 1]) } ) + console.timeEnd('RiotMatchList') const matchListToSave: MatchlistDto = [] for (const matchId of newMatchList.reverse()) { diff --git a/server/app/Services/StatsService.ts b/server/app/Services/StatsService.ts index 36600ac..43b271f 100644 --- a/server/app/Services/StatsService.ts +++ b/server/app/Services/StatsService.ts @@ -5,7 +5,10 @@ import BasicMatchSerializer from 'App/Serializers/BasicMatchSerializer' class StatsService { public async getRecentActivity(puuid: string) { - return MatchRepository.recentActivity(puuid) + console.time('RecentActivity') + const recentActivity = await MatchRepository.recentActivity(puuid) + console.timeEnd('RecentActivity') + return recentActivity } public async getSummonerStats(puuid: string, season?: number) { console.time('GLOBAL')