[Metrics UI] Ensure Kubernetes Pod CPU Usage is consistent across pages (#116177)

This commit is contained in:
Chris Cowan 2021-10-25 14:50:02 -06:00 committed by GitHub
parent 51f8feaea0
commit 74bc51ea7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,9 +25,23 @@ export const podOverview: TSVBMetricModelCreator = (
metrics: [
{
field: 'kubernetes.pod.cpu.usage.node.pct',
id: 'avg-cpu-usage',
id: 'avg-cpu-without',
type: 'avg',
},
{
field: 'kubernetes.pod.cpu.usage.limit.pct',
id: 'avg-cpu-with',
type: 'avg',
},
{
id: 'cpu-usage',
type: 'calculation',
variables: [
{ id: 'cpu_with', name: 'with_limit', field: 'avg-cpu-with' },
{ id: 'cpu_without', name: 'without_limit', field: 'avg-cpu-without' },
],
script: 'params.with_limit > 0.0 ? params.with_limit : params.without_limit',
},
],
},
{
@ -36,9 +50,23 @@ export const podOverview: TSVBMetricModelCreator = (
metrics: [
{
field: 'kubernetes.pod.memory.usage.node.pct',
id: 'avg-memory-usage',
id: 'avg-memory-without',
type: 'avg',
},
{
field: 'kubernetes.pod.memory.usage.limit.pct',
id: 'avg-memory-with',
type: 'avg',
},
{
id: 'memory-usage',
type: 'calculation',
variables: [
{ id: 'memory_with', name: 'with_limit', field: 'avg-memory-with' },
{ id: 'memory_without', name: 'without_limit', field: 'avg-memory-without' },
],
script: 'params.with_limit > 0.0 ? params.with_limit : params.without_limit',
},
],
},
{