add more statistics
All checks were successful
Deploy Backend / docker (ubuntu-latest) (push) Successful in 48s
Deploy Website / docker (ubuntu-latest) (push) Successful in 2m26s

This commit is contained in:
Lee
2024-10-24 14:36:24 +01:00
parent aaee96ad7b
commit 6d0c6aa47f
3 changed files with 27 additions and 0 deletions

View File

@ -1,5 +1,8 @@
import { PlayerModel } from "@ssr/common/model/player";
import { AppStatistics } from "@ssr/common/types/backend/app-statistics";
import { ScoreSaberScoreModel } from "@ssr/common/model/score/impl/scoresaber-score";
import { AdditionalScoreDataModel } from "@ssr/common/model/additional-score-data/additional-score-data";
import { BeatSaverMapModel } from "@ssr/common/model/beatsaver/map";
export class AppService {
/**
@ -7,9 +10,15 @@ export class AppService {
*/
public static async getAppStatistics(): Promise<AppStatistics> {
const trackedPlayers = await PlayerModel.countDocuments();
const trackedScores = await ScoreSaberScoreModel.countDocuments();
const additionalScoresData = await AdditionalScoreDataModel.countDocuments();
const cachedBeatSaverMaps = await BeatSaverMapModel.countDocuments();
return {
trackedPlayers,
trackedScores,
additionalScoresData,
cachedBeatSaverMaps,
};
}
}