rollup
This commit is contained in:
1 parent
dea0ff106f
commit
f56f91c31d
4 files changed
+156
-3
No files matched your search
@@ -560,14 +560,24 @@ class MonitorService implements IMonitorService {
|
||||
runningPercent: {
|
||||
$cond: [
|
||||
{ $gt: ["$totalContainers", 0] },
|
||||
{ $multiply: [{ $divide: ["$runningContainers", "$totalContainers"] }, 100] },
|
||||
{
|
||||
$multiply: [
|
||||
{ $divide: ["$runningContainers", "$totalContainers"] },
|
||||
100,
|
||||
],
|
||||
},
|
||||
null,
|
||||
],
|
||||
},
|
||||
healthyPercent: {
|
||||
$cond: [
|
||||
{ $gt: ["$totalContainers", 0] },
|
||||
{ $multiply: [{ $divide: ["$healthyContainers", "$totalContainers"] }, 100] },
|
||||
{
|
||||
$multiply: [
|
||||
{ $divide: ["$healthyContainers", "$totalContainers"] },
|
||||
100,
|
||||
],
|
||||
},
|
||||
null,
|
||||
],
|
||||
},
|
||||
@@ -744,6 +754,18 @@ class MonitorService implements IMonitorService {
|
||||
net: d.net,
|
||||
};
|
||||
}
|
||||
if (monitor.type === "docker") {
|
||||
return {
|
||||
...base,
|
||||
totalContainers: d.dockerTotalContainers,
|
||||
runningContainers: d.dockerRunningContainers,
|
||||
healthyContainers: d.dockerHealthyContainers,
|
||||
totalExposedPorts: d.dockerTotalExposedPorts,
|
||||
uniqueImages: d.dockerUniqueImages,
|
||||
runningPercent: d.dockerRunningPercent,
|
||||
healthyPercent: d.dockerHealthyPercent,
|
||||
};
|
||||
}
|
||||
return base;
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user