From e7ea1ed798695834d5d01621fa3c20c7adfde42c Mon Sep 17 00:00:00 2001 From: Madeline <46743919+MaddyUnderStars@users.noreply.github.com> Date: Fri, 2 Sep 2022 20:38:43 +1000 Subject: Status tracker now tracks sessions --- slowcord/status/src/index.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/slowcord/status/src/index.ts b/slowcord/status/src/index.ts index afec4743..b80893fa 100644 --- a/slowcord/status/src/index.ts +++ b/slowcord/status/src/index.ts @@ -51,9 +51,9 @@ const savePerf = async (time: number, name: string, error?: string | Error) => { } }; -const saveSystemUsage = async (load: number, procUptime: number, sysUptime: number, ram: number) => { +const saveSystemUsage = async (load: number, procUptime: number, sysUptime: number, ram: number, sessions: number) => { try { - await executePromise("INSERT INTO monitor (time, cpu, procUp, sysUp, ram) VALUES (?, ?, ?, ?, ?)", [new Date(), load, procUptime, sysUptime, ram]); + await executePromise("INSERT INTO monitor (time, cpu, procUp, sysUp, ram, sessions) VALUES (?, ?, ?, ?, ?, ?)", [new Date(), load, procUptime, sysUptime, ram, sessions]); } catch (e) { console.error(e); @@ -119,6 +119,7 @@ interface monitorzSchema { procUptime: number; sysUptime: number; memPercent: number; + sessions: number; } const app = async () => { @@ -141,7 +142,7 @@ const app = async () => { } }); const json = await res.json() as monitorzSchema; - await saveSystemUsage(json.load[1], json.procUptime, json.sysUptime, json.memPercent); + await saveSystemUsage(json.load[1], json.procUptime, json.sysUptime, json.memPercent, json.sessions); } catch (e) { } -- cgit 1.4.1