mirror of
https://github.com/portainer/portainer.git
synced 2025-07-21 22:39:41 +02:00
feat(kubernetes/resource-usage): k8s resource usage for cluster, node and namespace EE-3 EE-1112 (#5301)
* backported resource usage functionality from EE * utilising view bound endpoint object instead of depracated EndpointProvider * refactor flatmap * addressed merge conflict issues
This commit is contained in:
parent
cee7ac26e9
commit
ce31de5e9e
13 changed files with 188 additions and 30 deletions
|
@ -3,10 +3,15 @@ import angular from 'angular';
|
|||
class KubernetesResourceReservationController {
|
||||
usageValues() {
|
||||
if (this.cpuLimit) {
|
||||
this.cpuUsage = Math.round((this.cpu / this.cpuLimit) * 100);
|
||||
this.cpuReservationPercent = Math.round((this.cpuReservation / this.cpuLimit) * 100);
|
||||
}
|
||||
if (this.memoryLimit) {
|
||||
this.memoryUsage = Math.round((this.memory / this.memoryLimit) * 100);
|
||||
this.memoryReservationPercent = Math.round((this.memoryReservation / this.memoryLimit) * 100);
|
||||
}
|
||||
|
||||
if (this.displayUsage && this.cpuLimit && this.memoryLimit) {
|
||||
this.cpuUsagePercent = Math.round((this.cpuUsage / this.cpuLimit) * 100);
|
||||
this.memoryUsagePercent = Math.round((this.memoryUsage / this.memoryLimit) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue