aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2021-05-24 19:38:42 -0500
committermat <github@matdoes.dev>2021-05-24 19:38:42 -0500
commit17d2c47ec62f0bdea043cc6d0e09ac3c39a58ea1 (patch)
tree6026f2fce0e933bf13a7ee869294e4fc71e72c1e
parentee30474985ca2556f931e4ffd5e3643048bea1c5 (diff)
downloadskyblock-api-17d2c47ec62f0bdea043cc6d0e09ac3c39a58ea1.tar.gz
skyblock-api-17d2c47ec62f0bdea043cc6d0e09ac3c39a58ea1.tar.bz2
skyblock-api-17d2c47ec62f0bdea043cc6d0e09ac3c39a58ea1.zip
add cachedRawLeaderboards size to debug
-rw-r--r--src/database.ts2
-rw-r--r--src/hypixelCached.ts2
2 files changed, 3 insertions, 1 deletions
diff --git a/src/database.ts b/src/database.ts
index 35c04e8..42fb569 100644
--- a/src/database.ts
+++ b/src/database.ts
@@ -47,7 +47,7 @@ interface ProfileLeaderboardItem {
value: number
}
-const cachedRawLeaderboards: Map<string, (DatabaseMemberLeaderboardItem|DatabaseProfileLeaderboardItem)[]> = new Map()
+export const cachedRawLeaderboards: Map<string, (DatabaseMemberLeaderboardItem|DatabaseProfileLeaderboardItem)[]> = new Map()
const leaderboardMax = 100
const reversedLeaderboards = [
diff --git a/src/hypixelCached.ts b/src/hypixelCached.ts
index 1f6b7f2..47cf088 100644
--- a/src/hypixelCached.ts
+++ b/src/hypixelCached.ts
@@ -9,6 +9,7 @@ import { CleanPlayer } from './cleaners/player'
import { isUuid, undashUuid } from './util'
import { CleanProfile, CleanFullProfile, CleanBasicProfile } from './cleaners/skyblock/profile'
import { debug } from '.'
+import { cachedRawLeaderboards } from './database'
// cache usernames for 4 hours
/** uuid: username */
@@ -378,6 +379,7 @@ setInterval(() => {
console.log('basicPlayerCache', basicPlayerCache.getStats())
console.log('usernameCache', usernameCache.getStats())
console.log('profileCache', profileCache.getStats())
+ console.log('cachedRawLeaderboards size', cachedRawLeaderboards.size)
console.log(
Math.floor((process.memoryUsage().heapUsed / 1024 / 1024) * 10) / 10
+ 'mb')