2
This commit is contained in:
@@ -482,6 +482,7 @@ app.get('/api/metrics/overview', async (req, res) => {
|
||||
|
||||
// Aggregate across all sources
|
||||
let totalServers = 0;
|
||||
let activeServers = 0;
|
||||
let cpuUsed = 0, cpuTotal = 0;
|
||||
let memUsed = 0, memTotal = 0;
|
||||
let diskUsed = 0, diskTotal = 0;
|
||||
@@ -491,6 +492,7 @@ app.get('/api/metrics/overview', async (req, res) => {
|
||||
|
||||
for (const m of validMetrics) {
|
||||
totalServers += m.totalServers;
|
||||
activeServers += m.activeServers || m.totalServers; // Default if missing
|
||||
cpuUsed += m.cpu.used;
|
||||
cpuTotal += m.cpu.total;
|
||||
memUsed += m.memory.used;
|
||||
@@ -520,6 +522,7 @@ app.get('/api/metrics/overview', async (req, res) => {
|
||||
|
||||
res.json({
|
||||
totalServers,
|
||||
activeServers,
|
||||
cpu: {
|
||||
used: cpuUsed,
|
||||
total: cpuTotal,
|
||||
|
||||
Reference in New Issue
Block a user