forked from elastic/kibana
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Infra UI] Refactor Inventory Models (elastic#46403)
* [Infra UI] Refactor Inventory DSL * Updating types * Adding types * moving from metric_models to inventory_models * Fixing Kubernetes toolbars * Add models to index file * Removing snapshot metric aggregations in favor of inventory models * Removing TSVB models and replacing with inventory models * Fixing the glorious types * Removing obsolete layouts * removing obsolete message * removing toolbar
- Loading branch information
1 parent
14579af
commit 42b7ac6
Showing
104 changed files
with
1,897 additions
and
1,931 deletions.
There are no files selected for viewing
16 changes: 16 additions & 0 deletions
16
x-pack/legacy/plugins/infra/common/inventory_models/container/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { layout } from './layout'; | ||
import { metrics } from './metrics'; | ||
import { InventoryModel } from '../types'; | ||
|
||
export const container: InventoryModel = { | ||
id: 'container', | ||
requiredModules: ['docker'], | ||
layout, | ||
metrics, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
x-pack/legacy/plugins/infra/common/inventory_models/container/metrics/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { InventoryMetrics } from '../../types'; | ||
import { cpu } from './snapshot/cpu'; | ||
import { memory } from './snapshot/memory'; | ||
import { rx } from './snapshot/rx'; | ||
import { tx } from './snapshot/tx'; | ||
|
||
import { containerOverview } from './tsvb/container_overview'; | ||
import { containerCpuUsage } from './tsvb/container_cpu_usage'; | ||
import { containerCpuKernel } from './tsvb/container_cpu_kernel'; | ||
import { containerDiskIOOps } from './tsvb/container_diskio_ops'; | ||
import { containerDiskIOBytes } from './tsvb/container_disk_io_bytes'; | ||
import { containerMemory } from './tsvb/container_memory'; | ||
import { containerNetworkTraffic } from './tsvb/container_network_traffic'; | ||
|
||
export const metrics: InventoryMetrics = { | ||
tsvb: { | ||
containerOverview, | ||
containerCpuUsage, | ||
containerCpuKernel, | ||
containerDiskIOOps, | ||
containerDiskIOBytes, | ||
containerNetworkTraffic, | ||
containerMemory, | ||
}, | ||
snapshot: { cpu, memory, rx, tx }, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
x-pack/legacy/plugins/infra/common/inventory_models/container/metrics/snapshot/memory.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { SnapshotModel } from '../../../types'; | ||
|
||
export const memory: SnapshotModel = { memory: { avg: { field: 'docker.memory.usage.pct' } } }; |
12 changes: 12 additions & 0 deletions
12
x-pack/legacy/plugins/infra/common/inventory_models/container/metrics/snapshot/rx.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces'; | ||
export const rx = networkTrafficWithInterfaces( | ||
'rx', | ||
'docker.network.in.bytes', | ||
'docker.network.interface' | ||
); |
12 changes: 12 additions & 0 deletions
12
x-pack/legacy/plugins/infra/common/inventory_models/container/metrics/snapshot/tx.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License; | ||
* you may not use this file except in compliance with the Elastic License. | ||
*/ | ||
|
||
import { networkTrafficWithInterfaces } from '../../../shared/metrics/snapshot/network_traffic_with_interfaces'; | ||
export const tx = networkTrafficWithInterfaces( | ||
'tx', | ||
'docker.network.out.bytes', | ||
'docker.network.interface' | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.