mirror of
https://github.com/gethomepage/homepage.git
synced 2025-12-07 09:35:54 -08:00
Fix: Lint docker stats throughput PR
This commit is contained in:
@@ -18,16 +18,16 @@ export function calculateUsedMemory(stats) {
|
||||
}
|
||||
|
||||
export function calculateThroughput(stats) {
|
||||
let rx_bytes = 0;
|
||||
let tx_bytes = 0;
|
||||
let rxBytes = 0;
|
||||
let txBytes = 0;
|
||||
if (stats.networks?.network) {
|
||||
rx_bytes = stats.networks?.network.rx_bytes;
|
||||
tx_bytes = stats.networks?.network.tx_bytes;
|
||||
rxBytes = stats.networks?.network.rx_bytes;
|
||||
txBytes = stats.networks?.network.tx_bytes;
|
||||
} else if (stats.networks && Array.isArray(Object.values(stats.networks))) {
|
||||
Object.values(stats.networks).forEach((containerInterface) => {
|
||||
rx_bytes += containerInterface.rx_bytes;
|
||||
tx_bytes += containerInterface.tx_bytes;
|
||||
rxBytes += containerInterface.rx_bytes;
|
||||
txBytes += containerInterface.tx_bytes;
|
||||
});
|
||||
}
|
||||
return { rx_bytes, tx_bytes };
|
||||
return { rxBytes, txBytes };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user