1
0
mirror of https://github.com/lensapp/lens.git synced 2025-05-20 05:10:56 +00:00

Make legends consistent, and correct workloadMemoryUsage query.

Signed-off-by: Michael Pappas <mhagen@mapcom.com>
This commit is contained in:
Michael Pappas 2021-06-18 12:15:11 -04:00
parent 14c217906c
commit ef16c40b1b
3 changed files with 23 additions and 3 deletions

View File

@ -76,7 +76,7 @@ export class PrometheusOperator extends PrometheusProvider {
case "memoryUsage":
return `sum((node_memory_MemTotal_bytes - (node_memory_MemFree_bytes + node_memory_Buffers_bytes + node_memory_Cached_bytes)) * on (pod,namespace) group_left(node) kube_pod_info) by (node)`;
case "workloadMemoryUsage":
return `sum(container_memory_working_set_bytes{container!="POD",container!=""}) by (instance)`;
return `sum(container_memory_working_set_bytes{container!="POD",container!=""}) by (node)`;
case "memoryCapacity":
return `sum(kube_node_status_capacity{resource="memory"}) by (node)`;
case "memoryAllocatableCapacity":

View File

@ -174,7 +174,13 @@ export const ClusterPieCharts = observer(() => {
<PieChart
data={cpuData}
title="CPU"
legendColors={["#c93dce", "#4caf50", "#3d90ce", defaultColor]}
legendColors={[
"#c93dce",
"#4caf50",
"#3d90ce",
"#032b4d",
defaultColor,
]}
/>
{cpuLimitsOverload && renderLimitWarning()}
</div>
@ -182,7 +188,13 @@ export const ClusterPieCharts = observer(() => {
<PieChart
data={memoryData}
title="Memory"
legendColors={["#c93dce", "#4caf50", "#3d90ce", defaultColor]}
legendColors={[
"#c93dce",
"#4caf50",
"#3d90ce",
"#032b4d",
defaultColor,
]}
/>
{memoryLimitsOverload && renderLimitWarning()}
</div>

View File

@ -54,6 +54,7 @@ export const NodeCharts = observer(() => {
cpuUsage,
cpuRequests,
cpuCapacity,
cpuAllocatableCapacity,
podUsage,
podCapacity,
fsSize,
@ -77,6 +78,13 @@ export const NodeCharts = observer(() => {
borderColor: "#30b24d",
data: cpuRequests.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-cpuAllocatableCapacity`,
label: `Allocatable Capacity`,
tooltip: `CPU allocatable capacity`,
borderColor: "#032b4d",
data: cpuAllocatableCapacity.map(([x, y]) => ({ x, y }))
},
{
id: `${id}-cpuCapacity`,
label: `Capacity`,