1
0
mirror of https://github.com/spacebarchat/server.git synced 2024-11-23 02:42:28 +01:00

Added sessions to /-/monitorz

This commit is contained in:
Madeline 2022-09-02 20:33:41 +10:00
parent 071b171b5f
commit bf69f23e81
No known key found for this signature in database
GPG Key ID: 1958E017C36F2E47

View File

@ -1,5 +1,6 @@
import { Router, Response, Request } from "express";
import { route } from "@fosscord/api";
import { Session } from "@fosscord/util";
import os from "os";
const router = Router();
@ -10,6 +11,7 @@ router.get("/", route({ right: "OPERATOR" }), async (req: Request, res: Response
procUptime: process.uptime(),
sysUptime: os.uptime(),
memPercent: 100 - ((os.freemem() / os.totalmem()) * 100),
sessions: await Session.count(),
})
})