Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
mrCherry97 committed Dec 3, 2024
1 parent 3785e85 commit 080351f
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions src/components/Nodes/nodeQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,11 @@ const createUsageMetrics = (node, metricsForNode) => {
cpu: {
usage: cpuUsage,
capacity: cpuCapacity,
percentage: cpuPercentage + '%',
percentageValue: cpuPercentage,
},
memory: {
usage: memoryUsage,
capacity: memoryCapacity,
percentage: memoryPercentage + '%',
percentageValue: memoryPercentage,
},
};
Expand Down Expand Up @@ -141,7 +139,7 @@ function addResources(a, b) {
}
return a;
}
const addedResources = {
return {
limits: {
cpu: getCpus(a?.limits?.cpu) + getCpus(b?.limits?.cpu),
memory: getBytes(a?.limits?.memory) + getBytes(b?.limits?.memory),
Expand All @@ -151,7 +149,6 @@ function addResources(a, b) {
memory: getBytes(a?.requests?.memory) + getBytes(b?.requests?.memory),
},
};
return addedResources;
}

function sumContainersResources(containers) {
Expand Down Expand Up @@ -181,7 +178,7 @@ export function calcNodeResources(pods) {
},
requests: {
cpu: nodeResources.requests.cpu * 1000,
memory: nodeResources.requests.memory / 1024 / 1024 / 1024,
memory: nodeResources.requests.memory / Math.pow(1024, 3),
},
};
}
Expand Down

0 comments on commit 080351f

Please sign in to comment.