~jae/neos-metrics-exporter

0183b153a47364b4f73478a2e71c3c5e0df6ab55 — Jae Salokettu (J4) 8 months ago dd4e85e
neosApiClient: fix support for multiple users, remove debug data
1 files changed, 1 insertions(+), 4 deletions(-)

M src/utils/neosApiClient.ts
M src/utils/neosApiClient.ts => src/utils/neosApiClient.ts +1 -4
@@ 26,7 26,6 @@ export const generatePrometheusString = async (): Promise<string> => {
        const userData = await getSessionInfo(user);

        if (!userData || userData.onlineStatus !== 'Online' || !userData.activeSessions) {
            console.log("no sessions found");
            return;
        }



@@ 35,11 34,9 @@ export const generatePrometheusString = async (): Promise<string> => {
            return `player_count{label="${session.name}"} ${session.joinedUsers}`;
        });

        return prometheusString.join('\n');
        return `\n${prometheusString.join('\n')}`;
    }));

    console.log(fullPrometheusString);

    if (!fullPrometheusString) {
        return `player_count{label="total"} ${totalPlayers}`;
    }