mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-29 19:13:59 +00:00
SYNC: health
This commit is contained in:
committed by
Diflow
parent
3bb4652a49
commit
2c9fc7b4a7
@@ -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,
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user