mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 09:48:58 -04:00
Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
This commit is contained in:
parent
6053b4d0ef
commit
bf89b9dc2e
2 changed files with 34 additions and 2 deletions
|
@ -7,9 +7,27 @@
|
|||
import { SnapshotModel } from '../../../types';
|
||||
|
||||
export const cpu: SnapshotModel = {
|
||||
cpu: {
|
||||
cpu_with_limit: {
|
||||
avg: {
|
||||
field: 'kubernetes.pod.cpu.usage.limit.pct',
|
||||
},
|
||||
},
|
||||
cpu_without_limit: {
|
||||
avg: {
|
||||
field: 'kubernetes.pod.cpu.usage.node.pct',
|
||||
},
|
||||
},
|
||||
cpu: {
|
||||
bucket_script: {
|
||||
buckets_path: {
|
||||
with_limit: 'cpu_with_limit',
|
||||
without_limit: 'cpu_without_limit',
|
||||
},
|
||||
script: {
|
||||
source: 'params.with_limit > 0.0 ? params.with_limit : params.without_limit',
|
||||
lang: 'painless',
|
||||
},
|
||||
gap_policy: 'skip',
|
||||
},
|
||||
},
|
||||
};
|
||||
|
|
|
@ -24,9 +24,23 @@ export const podCpuUsage: 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',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue