added replicated size (#8043)

This commit is contained in:
Vadim Ogievetsky 2019-07-10 08:29:05 -07:00 committed by Fangjin Yang
parent 0a3538b569
commit 1712158734
2 changed files with 21 additions and 0 deletions

View File

@ -30,6 +30,7 @@ exports[`data source view matches snapshot 1`] = `
"Retention", "Retention",
"Compaction", "Compaction",
"Size", "Size",
"Replicated size",
"Num rows", "Num rows",
"Actions", "Actions",
] ]
@ -143,6 +144,14 @@ exports[`data source view matches snapshot 1`] = `
"show": true, "show": true,
"width": 100, "width": 100,
}, },
Object {
"Cell": [Function],
"Header": "Replicated size",
"accessor": "replicated_size",
"filterable": false,
"show": true,
"width": 100,
},
Object { Object {
"Cell": [Function], "Cell": [Function],
"Header": "Num rows", "Header": "Num rows",

View File

@ -57,6 +57,7 @@ const tableColumns: string[] = [
'Retention', 'Retention',
'Compaction', 'Compaction',
'Size', 'Size',
'Replicated size',
'Num rows', 'Num rows',
ActionCell.COLUMN_LABEL, ActionCell.COLUMN_LABEL,
]; ];
@ -100,6 +101,7 @@ interface DatasourceQueryResultRow {
num_segments_to_load: number; num_segments_to_load: number;
num_segments_to_drop: number; num_segments_to_drop: number;
size: number; size: number;
replicated_size: number;
num_rows: 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_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, 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") 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 SUM("num_rows") FILTER (WHERE (is_published = 1 AND is_overshadowed = 0) OR is_realtime = 1) AS num_rows
FROM sys.segments FROM sys.segments
GROUP BY 1`; GROUP BY 1`;
@ -201,6 +204,7 @@ GROUP BY 1`;
num_segments_to_load: segmentsToLoad, num_segments_to_load: segmentsToLoad,
num_segments_to_drop: 0, num_segments_to_drop: 0,
size: d.properties.segments.size, size: d.properties.segments.size,
replicated_size: -1,
num_rows: -1, num_rows: -1,
}; };
}, },
@ -761,6 +765,14 @@ GROUP BY 1`;
Cell: row => formatBytes(row.value), Cell: row => formatBytes(row.value),
show: hiddenColumns.exists('Size'), 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', Header: 'Num rows',
accessor: 'num_rows', accessor: 'num_rows',