From 17121587342f03be78ec3551d0521276ea01adb0 Mon Sep 17 00:00:00 2001 From: Vadim Ogievetsky Date: Wed, 10 Jul 2019 08:29:05 -0700 Subject: [PATCH] added replicated size (#8043) --- .../__snapshots__/datasource-view.spec.tsx.snap | 9 +++++++++ .../src/views/datasource-view/datasource-view.tsx | 12 ++++++++++++ 2 files changed, 21 insertions(+) diff --git a/web-console/src/views/datasource-view/__snapshots__/datasource-view.spec.tsx.snap b/web-console/src/views/datasource-view/__snapshots__/datasource-view.spec.tsx.snap index c2f33f2cfe0..b619181708a 100755 --- a/web-console/src/views/datasource-view/__snapshots__/datasource-view.spec.tsx.snap +++ b/web-console/src/views/datasource-view/__snapshots__/datasource-view.spec.tsx.snap @@ -30,6 +30,7 @@ exports[`data source view matches snapshot 1`] = ` "Retention", "Compaction", "Size", + "Replicated size", "Num rows", "Actions", ] @@ -143,6 +144,14 @@ exports[`data source view matches snapshot 1`] = ` "show": true, "width": 100, }, + Object { + "Cell": [Function], + "Header": "Replicated size", + "accessor": "replicated_size", + "filterable": false, + "show": true, + "width": 100, + }, Object { "Cell": [Function], "Header": "Num rows", diff --git a/web-console/src/views/datasource-view/datasource-view.tsx b/web-console/src/views/datasource-view/datasource-view.tsx index 9a4ae18c7cf..8297a71a89d 100644 --- a/web-console/src/views/datasource-view/datasource-view.tsx +++ b/web-console/src/views/datasource-view/datasource-view.tsx @@ -57,6 +57,7 @@ const tableColumns: string[] = [ 'Retention', 'Compaction', 'Size', + 'Replicated size', 'Num rows', ActionCell.COLUMN_LABEL, ]; @@ -100,6 +101,7 @@ interface DatasourceQueryResultRow { num_segments_to_load: number; num_segments_to_drop: number; size: number; + replicated_size: number; num_rows: number; } @@ -138,6 +140,7 @@ export class DatasourcesView extends React.PureComponent< COUNT(*) FILTER (WHERE is_published = 1 AND is_overshadowed = 0 AND is_available = 0) AS num_segments_to_load, COUNT(*) FILTER (WHERE is_available = 1 AND NOT ((is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1)) AS num_segments_to_drop, SUM("size") FILTER (WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS size, + SUM("size" * "num_replicas") FILTER (WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS replicated_size, SUM("num_rows") FILTER (WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS num_rows FROM sys.segments GROUP BY 1`; @@ -201,6 +204,7 @@ GROUP BY 1`; num_segments_to_load: segmentsToLoad, num_segments_to_drop: 0, size: d.properties.segments.size, + replicated_size: -1, num_rows: -1, }; }, @@ -761,6 +765,14 @@ GROUP BY 1`; Cell: row => formatBytes(row.value), show: hiddenColumns.exists('Size'), }, + { + Header: 'Replicated size', + accessor: 'replicated_size', + filterable: false, + width: 100, + Cell: row => formatBytes(row.value), + show: hiddenColumns.exists('Replicated size'), + }, { Header: 'Num rows', accessor: 'num_rows',