Add postgres private db stats

This commit is contained in:
Ajay
2023-07-23 14:26:25 -04:00
parent 528f24a431
commit ea80a413ba

View File

@@ -1,4 +1,4 @@
import { db } from "../databases/databases"; import { db, privateDB } from "../databases/databases";
import { Logger } from "../utils/logger"; import { Logger } from "../utils/logger";
import { Request, Response } from "express"; import { Request, Response } from "express";
import os from "os"; import os from "os";
@@ -45,6 +45,7 @@ export async function getStatus(req: Request, res: Response): Promise<Response>
statusRequests, statusRequests,
hostname: os.hostname(), hostname: os.hostname(),
postgresStats: (db as Postgres)?.getStats?.(), postgresStats: (db as Postgres)?.getStats?.(),
postgresPrivateStats: (privateDB as Postgres)?.getStats?.(),
redisStats: getRedisStats(), redisStats: getRedisStats(),
}; };
return value ? res.send(JSON.stringify(statusValues[value])) : res.send(statusValues); return value ? res.send(JSON.stringify(statusValues[value])) : res.send(statusValues);