mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Display Docker container's used memory instead of total memory
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
export default function calculateCPUPercent(stats) {
|
||||
export function calculateCPUPercent(stats) {
|
||||
let cpuPercent = 0.0;
|
||||
const cpuDelta = stats.cpu_stats.cpu_usage.total_usage - stats.precpu_stats.cpu_usage.total_usage;
|
||||
const systemDelta = stats.cpu_stats.system_cpu_usage - stats.precpu_stats.system_cpu_usage;
|
||||
@@ -9,3 +9,7 @@ export default function calculateCPUPercent(stats) {
|
||||
|
||||
return Math.round(cpuPercent * 10) / 10;
|
||||
}
|
||||
|
||||
export function calculateUsedMemory(stats) {
|
||||
return stats.memory_stats.usage - stats.memory_stats.stats.cache
|
||||
}
|
||||
Reference in New Issue
Block a user