diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx index 9797b6e731f42..91850aee16121 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table.tsx @@ -8,19 +8,64 @@ import type { Query, TimeRange } from '@kbn/es-query'; import React from 'react'; import type { DataView } from '@kbn/data-views-plugin/public'; +import { EuiBasicTable } from '@elastic/eui'; import { SnapshotNode } from '../../../../../common/http_api'; - +import { HostsTableColumns } from './hosts_table_columns'; interface Props { dataView: DataView; timeRange: TimeRange; query: Query; nodes: SnapshotNode[]; } + export const HostsTable: React.FunctionComponent = ({ dataView, timeRange, query, nodes, }) => { - return
eui table here from nodes
; + // return
eui table here from nodes
; + + const items = [ + { + os: 'MacOs', + cpuCores: 10, + name: 'Jennys-MBP.fritz.box', + rx: { + avg: 1234, + }, + tx: { + avg: 321, + }, + memory: { + avg: 543, + }, + servicesOnHost: 10, + averageMemoryUsagePercent: 5, + }, + { + os: 'Ubuntu', + cpuCores: 4, + name: 'Jennys-Ubuntu.fritz.box', + rx: { + avg: 223, + }, + tx: { + avg: 775, + }, + memory: { + avg: 3323, + }, + servicesOnHost: 4, + averageMemoryUsagePercent: 55, + }, + ]; + + return ( + + ); }; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx new file mode 100644 index 0000000000000..84197d02f8708 --- /dev/null +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/components/hosts_table_columns.tsx @@ -0,0 +1,78 @@ +/* + * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one + * or more contributor license agreements. Licensed under the Elastic License + * 2.0; you may not use this file except in compliance with the Elastic License + * 2.0. + */ + +import { EuiBasicTableColumn } from '@elastic/eui'; +import React from 'react'; +import { NumberCell } from '../../../../components/infrastructure_node_metrics_tables/shared/components'; + +export interface HostNodeRow { + name: string; + cpuCores: number | null; + os: string; + rx: { + avg: number | null; + }; + tx: { + avg: number | null; + }; + memory: { + avg: number | null; + }; + servicesOnHost: number | null; + averageMemoryUsagePercent: number | null; +} + +export const HostsTableColumns: Array> = [ + { + name: 'Name', + field: 'name', + truncateText: true, + render: (name: string) =>
{name}
, + }, + { + name: 'Operating System', + field: 'os', + render: (os: string) =>
{os}
, + }, + { + name: '# of CPUs', + field: 'cpuCores', + render: (cpuCores: number) => , + }, + { + name: 'Disk Latency', + field: 'cpuCores', + render: (ds: number) => , + }, + { + name: 'TX (avg.)', + field: 'tx', + render: (tx: { avg: number }) => , + }, + { + name: 'RX (avg.)', + field: 'rx', + render: (rx: { avg: number }) => , + }, + { + name: 'Memory total (avg.)', + field: 'memory', + render: (memory: { avg: number }) => , + }, + { + name: 'Services on Host', + field: 'servicesOnHost', + render: (servicesOnHost: number) => , + }, + { + name: 'Memory usage (avg.)', + field: 'averageMemoryUsagePercent', + render: (averageMemoryUsagePercent: number) => ( + + ), + }, +]; diff --git a/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx b/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx index 18333a1bd0ecf..6828103306047 100644 --- a/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx +++ b/x-pack/plugins/infra/public/pages/metrics/hosts/hosts_content.tsx @@ -9,6 +9,7 @@ import type { Query, TimeRange } from '@kbn/es-query'; import { i18n } from '@kbn/i18n'; import React, { useState, useCallback } from 'react'; import { SearchBar } from '@kbn/unified-search-plugin/public'; +import { EuiSpacer } from '@elastic/eui'; import { NoData } from '../../../components/empty_states'; import { InfraLoadingPanel } from '../../../components/loading'; import { useMetricsDataViewContext } from './hooks/use_data_view'; @@ -91,6 +92,7 @@ export const HostsContent: React.FunctionComponent = () => { indexPatterns={[metricsDataView]} onQuerySubmit={onQuerySubmit} /> +