mirror of
https://github.com/vkaelin/LeagueStats.git
synced 2026-03-25 12:57:28 +00:00
fix: add some console.time to check which mongo query is slow
This commit is contained in:
parent
8b90dbf80b
commit
c88e43ee4a
1 changed files with 12 additions and 0 deletions
|
|
@ -10,8 +10,13 @@ class StatsService {
|
||||||
|
|
||||||
async getSummonerStats(account, season) {
|
async getSummonerStats(account, season) {
|
||||||
this.matchRepository.season = season
|
this.matchRepository.season = season
|
||||||
|
console.time('GLOBAL')
|
||||||
const globalStats = await this.matchRepository.globalStats(account.puuid)
|
const globalStats = await this.matchRepository.globalStats(account.puuid)
|
||||||
|
console.timeEnd('GLOBAL')
|
||||||
|
console.time('GAMEMODE')
|
||||||
const gamemodeStats = await this.matchRepository.gamemodeStats(account.puuid)
|
const gamemodeStats = await this.matchRepository.gamemodeStats(account.puuid)
|
||||||
|
console.timeEnd('GAMEMODE')
|
||||||
|
console.time('ROLE')
|
||||||
const roleStats = await this.matchRepository.roleStats(account.puuid)
|
const roleStats = await this.matchRepository.roleStats(account.puuid)
|
||||||
// Check if all roles are in the array
|
// Check if all roles are in the array
|
||||||
const roles = ['TOP', 'JUNGLE', 'MIDDLE', 'BOTTOM', 'SUPPORT']
|
const roles = ['TOP', 'JUNGLE', 'MIDDLE', 'BOTTOM', 'SUPPORT']
|
||||||
|
|
@ -25,9 +30,16 @@ class StatsService {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
console.timeEnd('ROLE')
|
||||||
|
console.time('CHAMPION')
|
||||||
const championStats = await this.matchRepository.championStats(account.puuid, 5)
|
const championStats = await this.matchRepository.championStats(account.puuid, 5)
|
||||||
|
console.timeEnd('CHAMPION')
|
||||||
|
console.time('CHAMPION-CLASS')
|
||||||
const championClassStats = await this.matchRepository.championClassStats(account.puuid)
|
const championClassStats = await this.matchRepository.championClassStats(account.puuid)
|
||||||
|
console.timeEnd('CHAMPION-CLASS')
|
||||||
|
console.time('MATES')
|
||||||
const mates = await this.matchRepository.mates(account.puuid)
|
const mates = await this.matchRepository.mates(account.puuid)
|
||||||
|
console.timeEnd('MATES')
|
||||||
|
|
||||||
return {
|
return {
|
||||||
global: globalStats[0],
|
global: globalStats[0],
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue