Skip to content

Commit

Permalink
[Metrics UI] Ensure Kubernetes Pod CPU Usage is consistent across pag…
Browse files Browse the repository at this point in the history
…es (#116177)
  • Loading branch information
simianhacker authored Oct 25, 2021
1 parent 51f8fea commit 74bc51e
Showing 1 changed file with 30 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
},
{
Expand All @@ -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',
},
],
},
{
Expand Down

0 comments on commit 74bc51e

Please sign in to comment.