SYNC: health

This commit is contained in:
SPRINX0\prochazka
2025-03-17 14:11:31 +01:00
committed by Diflow
parent 3bb4652a49
commit 2c9fc7b4a7

View File

@@ -7,18 +7,20 @@ const runners = require('../controllers/runners');
async function getHealthStatus() { async function getHealthStatus() {
const memory = process.memoryUsage(); const memory = process.memoryUsage();
const cpuUsage = process.cpuUsage();
return { return {
status: 'ok', status: 'ok',
databaseConnectionCount: databaseConnections.opened.length, databaseConnectionCount: databaseConnections.opened.length,
serverConnectionCount: serverConnections.opened.length, serverConnectionCount: serverConnections.opened.length,
sessionCount: sessions.opened.length, sessionCount: sessions.opened.length,
runProcessCount: runners.opened.length,
memory, memory,
cpuUsage,
systemMemory: { systemMemory: {
total: os.totalmem(), total: os.totalmem(),
free: os.freemem(), free: os.freemem(),
}, },
runProcessCount: runners.opened.length,
}; };
} }