ydb-embedded-ui 4.17.0 → 4.19.0
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +30 -0
- package/dist/components/FullNodeViewer/FullNodeViewer.scss +1 -1
- package/dist/components/FullNodeViewer/FullNodeViewer.tsx +15 -6
- package/dist/components/InfoViewer/formatters/common.ts +1 -1
- package/dist/components/InfoViewer/formatters/pqGroup.ts +1 -1
- package/dist/components/InfoViewer/formatters/table.ts +6 -1
- package/dist/components/ProgressViewer/ProgressViewer.tsx +105 -0
- package/dist/components/TooltipsContent/TabletTooltipContent/TabletTooltipContent.tsx +1 -1
- package/dist/containers/AsideNavigation/AsideNavigation.tsx +3 -1
- package/dist/containers/Authentication/Authentication.tsx +14 -4
- package/dist/containers/Cluster/ClusterInfo/ClusterInfo.tsx +2 -2
- package/dist/containers/Heatmap/Heatmap.tsx +1 -1
- package/dist/containers/Heatmap/Histogram/Histogram.js +1 -1
- package/dist/containers/Node/NodeStructure/Pdisk.tsx +2 -2
- package/dist/containers/Node/NodeStructure/Vdisk.tsx +5 -2
- package/dist/containers/Nodes/getNodesColumns.tsx +3 -2
- package/dist/containers/Storage/PDisk/PDisk.tsx +1 -1
- package/dist/containers/Storage/PDiskPopup/PDiskPopup.tsx +2 -2
- package/dist/containers/Storage/StorageGroups/StorageGroups.tsx +3 -232
- package/dist/containers/Storage/StorageGroups/getStorageGroupsColumns.tsx +278 -0
- package/dist/containers/Storage/VDisk/VDisk.tsx +1 -1
- package/dist/containers/Storage/VDiskPopup/VDiskPopup.tsx +1 -1
- package/dist/containers/Tablet/TabletInfo/TabletInfo.tsx +1 -1
- package/dist/containers/Tablet/TabletTable/TabletTable.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/TopicStats/ConsumersTopicStats.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Consumers/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/DetailedOverview/DetailedOverview.tsx +3 -3
- package/dist/containers/Tenant/Diagnostics/Overview/TableInfo/prepareTableInfo.ts +1 -1
- package/dist/containers/Tenant/Diagnostics/Overview/TopicStats/TopicStats.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/Partitions/columns/columns.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/MetricsCards/MetricsCards.tsx +2 -3
- package/dist/containers/Tenant/Diagnostics/TenantOverview/OldTenantOverview.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantOverview.tsx +22 -6
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.scss +41 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TenantStorage.tsx +68 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopGroups.tsx +76 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.tsx +105 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/en.json +2 -0
- package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/ru.json +2 -0
- package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.tsx +1 -1
- package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.tsx +1 -1
- package/dist/containers/Tenant/ObjectSummary/ObjectSummary.tsx +1 -1
- package/dist/containers/Tenants/Tenants.tsx +5 -1
- package/dist/containers/UserSettings/i18n/en.json +1 -1
- package/dist/containers/UserSettings/i18n/ru.json +1 -1
- package/dist/containers/UserSettings/settings.ts +2 -2
- package/dist/containers/Versions/NodesTable/NodesTable.tsx +3 -2
- package/dist/services/api.ts +1 -1
- package/dist/store/reducers/clusterNodes/clusterNodes.tsx +1 -1
- package/dist/store/reducers/index.ts +4 -0
- package/dist/store/reducers/node/selectors.ts +1 -1
- package/dist/store/reducers/nodes/selectors.ts +1 -1
- package/dist/store/reducers/nodes/types.ts +1 -1
- package/dist/store/reducers/nodes/utils.ts +1 -1
- package/dist/store/reducers/settings/settings.ts +4 -4
- package/dist/store/reducers/storage/types.ts +1 -1
- package/dist/store/reducers/storage/utils.ts +21 -12
- package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.ts +93 -0
- package/dist/store/reducers/tenantOverview/executeTopTables/types.ts +14 -0
- package/dist/store/reducers/tenantOverview/topStorageGroups/topStorageGroups.ts +98 -0
- package/dist/store/reducers/tenantOverview/topStorageGroups/types.ts +29 -0
- package/dist/store/reducers/tenantOverview/topStorageGroups/utils.ts +20 -0
- package/dist/store/reducers/tenants/utils.ts +30 -20
- package/dist/styles/constants.scss +4 -0
- package/dist/types/additionalProps.ts +1 -1
- package/dist/types/api/storage.ts +1 -1
- package/dist/types/api/tenant.ts +21 -8
- package/dist/types/api/vdisk.ts +1 -1
- package/dist/utils/bytesParsers/__test__/formatBytes.test.ts +10 -1
- package/dist/utils/bytesParsers/formatBytes.ts +3 -3
- package/dist/utils/constants.ts +10 -1
- package/dist/utils/dataFormatters/__test__/roundToSignificant.test.ts +22 -0
- package/dist/utils/dataFormatters/dataFormatters.ts +150 -0
- package/dist/utils/dataFormatters/i18n/en.json +3 -0
- package/dist/utils/dataFormatters/i18n/ru.json +3 -0
- package/dist/utils/index.js +0 -102
- package/package.json +1 -1
- package/dist/components/ProgressViewer/ProgressViewer.js +0 -92
- package/dist/utils/formatCPU/formatCPU.ts +0 -20
- package/dist/utils/formatCPU/i18n/en.json +0 -3
- package/dist/utils/formatCPU/i18n/ru.json +0 -3
- /package/dist/utils/{formatCPU → dataFormatters}/i18n/index.ts +0 -0
@@ -27,7 +27,7 @@ export interface TenantMetrics {
|
|
27
27
|
memoryUsed?: number;
|
28
28
|
memoryLimit?: number;
|
29
29
|
cpuUsed?: number;
|
30
|
-
|
30
|
+
cpuUsage?: number;
|
31
31
|
storageUsed?: number;
|
32
32
|
storageLimit?: number;
|
33
33
|
}
|
@@ -51,11 +51,10 @@ export function MetricsCards({
|
|
51
51
|
}: MetricsCardsProps) {
|
52
52
|
const location = useLocation();
|
53
53
|
|
54
|
-
const {memoryUsed, memoryLimit, cpuUsed,
|
54
|
+
const {memoryUsed, memoryLimit, cpuUsed, cpuUsage, storageUsed, storageLimit} = metrics || {};
|
55
55
|
|
56
56
|
const {metricsTab} = useTypedSelector((state) => state.tenant);
|
57
57
|
|
58
|
-
const cpuUsage = calculateUsage(cpuUsed, cpuLimit);
|
59
58
|
const storageUsage = calculateUsage(storageUsed, storageLimit);
|
60
59
|
const memoryUsage = calculateUsage(memoryUsed, memoryLimit);
|
61
60
|
|
@@ -8,7 +8,7 @@ import {InfoViewer} from '../../../../components/InfoViewer';
|
|
8
8
|
import {PoolUsage} from '../../../../components/PoolUsage/PoolUsage';
|
9
9
|
import {Tablet} from '../../../../components/Tablet';
|
10
10
|
import EntityStatus from '../../../../components/EntityStatus/EntityStatus';
|
11
|
-
import {formatCPU} from '../../../../utils';
|
11
|
+
import {formatCPU} from '../../../../utils/dataFormatters/dataFormatters';
|
12
12
|
import {TABLET_STATES, TENANT_DEFAULT_TITLE} from '../../../../utils/constants';
|
13
13
|
import {bytesToGB} from '../../../../utils/utils';
|
14
14
|
import {mapDatabaseTypeToDBName} from '../../utils/schema';
|
@@ -14,6 +14,7 @@ import {getTenantInfo, setDataWasNotLoaded} from '../../../../store/reducers/ten
|
|
14
14
|
import {calculateTenantMetrics} from '../../../../store/reducers/tenants/utils';
|
15
15
|
import {HealthcheckDetails} from './Healthcheck/HealthcheckDetails';
|
16
16
|
import {MetricsCards, type TenantMetrics} from './MetricsCards/MetricsCards';
|
17
|
+
import {TenantStorage} from './TenantStorage/TenantStorage';
|
17
18
|
import {useHealthcheck} from './useHealthcheck';
|
18
19
|
|
19
20
|
import i18n from './i18n';
|
@@ -70,16 +71,31 @@ export function TenantOverview({tenantName, additionalTenantProps}: TenantOvervi
|
|
70
71
|
|
71
72
|
const tenantType = mapDatabaseTypeToDBName(Type);
|
72
73
|
|
73
|
-
const {
|
74
|
-
|
74
|
+
const {
|
75
|
+
cpu,
|
76
|
+
blobStorage,
|
77
|
+
tableStorage,
|
78
|
+
memory,
|
79
|
+
cpuUsage,
|
80
|
+
blobStorageLimit,
|
81
|
+
tableStorageLimit,
|
82
|
+
memoryLimit,
|
83
|
+
} = calculateTenantMetrics(tenant);
|
75
84
|
|
76
85
|
const calculatedMetrics: TenantMetrics = {
|
77
86
|
memoryUsed: memory,
|
78
87
|
memoryLimit,
|
79
88
|
cpuUsed: cpu,
|
80
|
-
|
81
|
-
storageUsed:
|
82
|
-
storageLimit,
|
89
|
+
cpuUsage,
|
90
|
+
storageUsed: blobStorage,
|
91
|
+
storageLimit: blobStorageLimit,
|
92
|
+
};
|
93
|
+
|
94
|
+
const storageMetrics = {
|
95
|
+
blobStorageUsed: blobStorage,
|
96
|
+
blobStorageLimit,
|
97
|
+
tableStorageUsed: tableStorage,
|
98
|
+
tableStorageLimit,
|
83
99
|
};
|
84
100
|
|
85
101
|
const renderName = () => {
|
@@ -102,7 +118,7 @@ export function TenantOverview({tenantName, additionalTenantProps}: TenantOvervi
|
|
102
118
|
return i18n('label.under-development');
|
103
119
|
}
|
104
120
|
case TENANT_METRICS_TABS_IDS.storage: {
|
105
|
-
return
|
121
|
+
return <TenantStorage tenantName={tenantName} metrics={storageMetrics} />;
|
106
122
|
}
|
107
123
|
case TENANT_METRICS_TABS_IDS.memory: {
|
108
124
|
return i18n('label.under-development');
|
@@ -0,0 +1,41 @@
|
|
1
|
+
@import '../../../../../styles/mixins.scss';
|
2
|
+
|
3
|
+
.tenant-overview-storage {
|
4
|
+
&__info {
|
5
|
+
margin-bottom: 36px;
|
6
|
+
}
|
7
|
+
|
8
|
+
&__title {
|
9
|
+
margin-bottom: 10px;
|
10
|
+
|
11
|
+
font-size: var(--yc-text-body-2-font-size);
|
12
|
+
font-weight: 700;
|
13
|
+
line-height: var(--yc-text-body-2-line-height);
|
14
|
+
}
|
15
|
+
|
16
|
+
&__table {
|
17
|
+
width: var(--diagnostics-section-table-width);
|
18
|
+
@include table-styles;
|
19
|
+
|
20
|
+
&:not(:last-child) {
|
21
|
+
margin-bottom: var(--diagnostics-section-margin);
|
22
|
+
}
|
23
|
+
|
24
|
+
th {
|
25
|
+
height: 40px;
|
26
|
+
|
27
|
+
vertical-align: middle;
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
&__cell-with-popover-wrapper {
|
32
|
+
display: flex;
|
33
|
+
}
|
34
|
+
|
35
|
+
&__cell-with-popover {
|
36
|
+
overflow: hidden;
|
37
|
+
|
38
|
+
white-space: nowrap;
|
39
|
+
text-overflow: ellipsis;
|
40
|
+
}
|
41
|
+
}
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
|
3
|
+
import InfoViewer from '../../../../../components/InfoViewer/InfoViewer';
|
4
|
+
import {ProgressViewer} from '../../../../../components/ProgressViewer/ProgressViewer';
|
5
|
+
import {formatStorageValues} from '../../../../../utils/dataFormatters/dataFormatters';
|
6
|
+
import {getSizeWithSignificantDigits} from '../../../../../utils/bytesParsers';
|
7
|
+
import {TopTables} from './TopTables';
|
8
|
+
import {TopGroups} from './TopGroups';
|
9
|
+
import './TenantStorage.scss';
|
10
|
+
|
11
|
+
const b = cn('tenant-overview-storage');
|
12
|
+
|
13
|
+
export interface TenantStorageMetrics {
|
14
|
+
blobStorageUsed?: number;
|
15
|
+
blobStorageLimit?: number;
|
16
|
+
tableStorageUsed?: number;
|
17
|
+
tableStorageLimit?: number;
|
18
|
+
}
|
19
|
+
|
20
|
+
interface TenantStorageProps {
|
21
|
+
tenantName: string;
|
22
|
+
metrics: TenantStorageMetrics;
|
23
|
+
}
|
24
|
+
|
25
|
+
export function TenantStorage({tenantName, metrics}: TenantStorageProps) {
|
26
|
+
const {blobStorageUsed, tableStorageUsed, blobStorageLimit, tableStorageLimit} = metrics;
|
27
|
+
const formatValues = (value?: number, total?: number) => {
|
28
|
+
const size = getSizeWithSignificantDigits(Number(blobStorageLimit || blobStorageUsed), 0);
|
29
|
+
|
30
|
+
return formatStorageValues(value, total, size);
|
31
|
+
};
|
32
|
+
|
33
|
+
const info = [
|
34
|
+
{
|
35
|
+
label: 'Database storage',
|
36
|
+
value: (
|
37
|
+
<ProgressViewer
|
38
|
+
value={blobStorageUsed}
|
39
|
+
capacity={blobStorageLimit}
|
40
|
+
formatValues={formatValues}
|
41
|
+
colorizeProgress={true}
|
42
|
+
warningThreshold={75}
|
43
|
+
dangerThreshold={85}
|
44
|
+
/>
|
45
|
+
),
|
46
|
+
},
|
47
|
+
{
|
48
|
+
label: 'Table storage',
|
49
|
+
value: (
|
50
|
+
<ProgressViewer
|
51
|
+
value={tableStorageUsed}
|
52
|
+
capacity={tableStorageLimit}
|
53
|
+
formatValues={formatValues}
|
54
|
+
colorizeProgress={true}
|
55
|
+
warningThreshold={75}
|
56
|
+
dangerThreshold={85}
|
57
|
+
/>
|
58
|
+
),
|
59
|
+
},
|
60
|
+
];
|
61
|
+
return (
|
62
|
+
<>
|
63
|
+
<InfoViewer className={b('info')} title="Storage details" info={info} />
|
64
|
+
<TopTables path={tenantName} />
|
65
|
+
<TopGroups tenant={tenantName} />
|
66
|
+
</>
|
67
|
+
);
|
68
|
+
}
|
@@ -0,0 +1,76 @@
|
|
1
|
+
import cn from 'bem-cn-lite';
|
2
|
+
import {useCallback} from 'react';
|
3
|
+
import {useDispatch} from 'react-redux';
|
4
|
+
|
5
|
+
import DataTable from '@gravity-ui/react-data-table';
|
6
|
+
|
7
|
+
import {useAutofetcher, useTypedSelector} from '../../../../../utils/hooks';
|
8
|
+
import {
|
9
|
+
TENANT_OVERVIEW_TABLES_LIMIT,
|
10
|
+
TENANT_OVERVIEW_TABLES_SETTINGS,
|
11
|
+
} from '../../../../../utils/constants';
|
12
|
+
import {
|
13
|
+
setDataWasNotLoaded,
|
14
|
+
getTopStorageGroups,
|
15
|
+
selectTopStorageGroups,
|
16
|
+
} from '../../../../../store/reducers/tenantOverview/topStorageGroups/topStorageGroups';
|
17
|
+
import {ResponseError} from '../../../../../components/Errors/ResponseError';
|
18
|
+
import {TableSkeleton} from '../../../../../components/TableSkeleton/TableSkeleton';
|
19
|
+
import {getStorageTopGroupsColumns} from '../../../../Storage/StorageGroups/getStorageGroupsColumns';
|
20
|
+
import i18n from '../i18n';
|
21
|
+
|
22
|
+
const b = cn('tenant-overview-storage');
|
23
|
+
|
24
|
+
interface TopGroupsProps {
|
25
|
+
tenant?: string;
|
26
|
+
}
|
27
|
+
|
28
|
+
export function TopGroups({tenant}: TopGroupsProps) {
|
29
|
+
const dispatch = useDispatch();
|
30
|
+
|
31
|
+
const {autorefresh} = useTypedSelector((state) => state.schema);
|
32
|
+
const {loading, wasLoaded, error} = useTypedSelector((state) => state.topStorageGroups);
|
33
|
+
const topGroups = useTypedSelector(selectTopStorageGroups);
|
34
|
+
|
35
|
+
const columns = getStorageTopGroupsColumns();
|
36
|
+
|
37
|
+
const fetchData = useCallback(
|
38
|
+
(isBackground: boolean) => {
|
39
|
+
if (!isBackground) {
|
40
|
+
dispatch(setDataWasNotLoaded());
|
41
|
+
}
|
42
|
+
|
43
|
+
dispatch(getTopStorageGroups({tenant}));
|
44
|
+
},
|
45
|
+
[dispatch, tenant],
|
46
|
+
);
|
47
|
+
|
48
|
+
useAutofetcher(fetchData, [fetchData], autorefresh);
|
49
|
+
|
50
|
+
const renderContent = () => {
|
51
|
+
if (error) {
|
52
|
+
return <ResponseError error={error} />;
|
53
|
+
}
|
54
|
+
|
55
|
+
if (loading && !wasLoaded) {
|
56
|
+
return <TableSkeleton rows={TENANT_OVERVIEW_TABLES_LIMIT} />;
|
57
|
+
}
|
58
|
+
|
59
|
+
return (
|
60
|
+
<DataTable
|
61
|
+
theme="yandex-cloud"
|
62
|
+
data={topGroups || []}
|
63
|
+
columns={columns}
|
64
|
+
settings={TENANT_OVERVIEW_TABLES_SETTINGS}
|
65
|
+
emptyDataMessage={i18n('top-groups.empty-data')}
|
66
|
+
/>
|
67
|
+
);
|
68
|
+
};
|
69
|
+
|
70
|
+
return (
|
71
|
+
<>
|
72
|
+
<div className={b('title')}>Top groups by usage</div>
|
73
|
+
<div className={b('table')}>{renderContent()}</div>
|
74
|
+
</>
|
75
|
+
);
|
76
|
+
}
|
@@ -0,0 +1,105 @@
|
|
1
|
+
import {useDispatch} from 'react-redux';
|
2
|
+
import cn from 'bem-cn-lite';
|
3
|
+
|
4
|
+
import DataTable, {Column} from '@gravity-ui/react-data-table';
|
5
|
+
import {Popover} from '@gravity-ui/uikit';
|
6
|
+
|
7
|
+
import {useAutofetcher, useTypedSelector} from '../../../../../utils/hooks';
|
8
|
+
import {
|
9
|
+
fetchTopTables,
|
10
|
+
setDataWasNotLoaded,
|
11
|
+
} from '../../../../../store/reducers/tenantOverview/executeTopTables/executeTopTables';
|
12
|
+
import {
|
13
|
+
TENANT_OVERVIEW_TABLES_LIMIT,
|
14
|
+
TENANT_OVERVIEW_TABLES_SETTINGS,
|
15
|
+
} from '../../../../../utils/constants';
|
16
|
+
import type {KeyValueRow} from '../../../../../types/api/query';
|
17
|
+
import {formatBytes, getSizeWithSignificantDigits} from '../../../../../utils/bytesParsers';
|
18
|
+
import {TableSkeleton} from '../../../../../components/TableSkeleton/TableSkeleton';
|
19
|
+
import {ResponseError} from '../../../../../components/Errors/ResponseError';
|
20
|
+
|
21
|
+
import './TenantStorage.scss';
|
22
|
+
|
23
|
+
const b = cn('tenant-overview-storage');
|
24
|
+
|
25
|
+
interface TopTablesProps {
|
26
|
+
path: string;
|
27
|
+
}
|
28
|
+
|
29
|
+
export function TopTables({path}: TopTablesProps) {
|
30
|
+
const dispatch = useDispatch();
|
31
|
+
|
32
|
+
const {autorefresh} = useTypedSelector((state) => state.schema);
|
33
|
+
|
34
|
+
const {
|
35
|
+
loading,
|
36
|
+
wasLoaded,
|
37
|
+
error,
|
38
|
+
data: {result: data = undefined} = {},
|
39
|
+
} = useTypedSelector((state) => state.executeTopTables);
|
40
|
+
|
41
|
+
useAutofetcher(
|
42
|
+
(isBackground) => {
|
43
|
+
if (!isBackground) {
|
44
|
+
dispatch(setDataWasNotLoaded());
|
45
|
+
}
|
46
|
+
|
47
|
+
dispatch(fetchTopTables(path));
|
48
|
+
},
|
49
|
+
[dispatch, path],
|
50
|
+
autorefresh,
|
51
|
+
);
|
52
|
+
|
53
|
+
const formatSize = (value?: number) => {
|
54
|
+
const size = getSizeWithSignificantDigits(data?.length ? Number(data[0].Size) : 0, 0);
|
55
|
+
|
56
|
+
return formatBytes({value, size, precision: 1});
|
57
|
+
};
|
58
|
+
|
59
|
+
const columns: Column<KeyValueRow>[] = [
|
60
|
+
{
|
61
|
+
name: 'Size',
|
62
|
+
width: 80,
|
63
|
+
sortable: false,
|
64
|
+
render: ({row}) => formatSize(Number(row.Size)),
|
65
|
+
align: DataTable.RIGHT,
|
66
|
+
},
|
67
|
+
{
|
68
|
+
name: 'Path',
|
69
|
+
sortable: false,
|
70
|
+
render: ({row}) => (
|
71
|
+
<div className={b('cell-with-popover-wrapper')}>
|
72
|
+
<Popover className={b('cell-with-popover')} content={row.Path}>
|
73
|
+
{row.Path}
|
74
|
+
</Popover>
|
75
|
+
</div>
|
76
|
+
),
|
77
|
+
},
|
78
|
+
];
|
79
|
+
|
80
|
+
const renderContent = () => {
|
81
|
+
if (error) {
|
82
|
+
return <ResponseError error={error} />;
|
83
|
+
}
|
84
|
+
|
85
|
+
if (loading && !wasLoaded) {
|
86
|
+
return <TableSkeleton rows={TENANT_OVERVIEW_TABLES_LIMIT} />;
|
87
|
+
}
|
88
|
+
|
89
|
+
return (
|
90
|
+
<DataTable
|
91
|
+
theme="yandex-cloud"
|
92
|
+
columns={columns}
|
93
|
+
settings={TENANT_OVERVIEW_TABLES_SETTINGS}
|
94
|
+
data={data || []}
|
95
|
+
/>
|
96
|
+
);
|
97
|
+
};
|
98
|
+
|
99
|
+
return (
|
100
|
+
<>
|
101
|
+
<div className={b('title')}>Top tables by size</div>
|
102
|
+
<div className={b('table')}>{renderContent()}</div>
|
103
|
+
</>
|
104
|
+
);
|
105
|
+
}
|
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
TENANT_PAGES_IDS,
|
29
29
|
TENANT_QUERY_TABS_ID,
|
30
30
|
} from '../../../../store/reducers/tenant/constants';
|
31
|
-
import {formatDateTime, formatNumber} from '../../../../utils';
|
31
|
+
import {formatDateTime, formatNumber} from '../../../../utils/dataFormatters/dataFormatters';
|
32
32
|
import {HOUR_IN_SECONDS} from '../../../../utils/constants';
|
33
33
|
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
34
34
|
import {prepareQueryError} from '../../../../utils/query';
|
@@ -22,7 +22,7 @@ import {EShardsWorkloadMode, IShardsWorkloadFilters} from '../../../../types/sto
|
|
22
22
|
import type {EPathType} from '../../../../types/api/schema';
|
23
23
|
import type {CellValue, KeyValueRow} from '../../../../types/api/query';
|
24
24
|
|
25
|
-
import {formatDateTime, formatNumber} from '../../../../utils';
|
25
|
+
import {formatDateTime, formatNumber} from '../../../../utils/dataFormatters/dataFormatters';
|
26
26
|
import {DEFAULT_TABLE_SETTINGS, HOUR_IN_SECONDS} from '../../../../utils/constants';
|
27
27
|
import {useAutofetcher, useTypedSelector} from '../../../../utils/hooks';
|
28
28
|
import {prepareQueryError} from '../../../../utils/query';
|
@@ -24,7 +24,7 @@ import {
|
|
24
24
|
TColumnTableDescription,
|
25
25
|
} from '../../../types/api/schema';
|
26
26
|
import routes, {createHref} from '../../../routes';
|
27
|
-
import {formatDateTime} from '../../../utils';
|
27
|
+
import {formatDateTime} from '../../../utils/dataFormatters/dataFormatters';
|
28
28
|
import {useTypedSelector} from '../../../utils/hooks';
|
29
29
|
import {
|
30
30
|
DEFAULT_IS_TENANT_COMMON_INFO_COLLAPSED,
|
@@ -26,7 +26,11 @@ import {
|
|
26
26
|
ProblemFilterValues,
|
27
27
|
selectProblemFilter,
|
28
28
|
} from '../../store/reducers/settings/settings';
|
29
|
-
import {
|
29
|
+
import {
|
30
|
+
formatBytesToGigabyte,
|
31
|
+
formatCPU,
|
32
|
+
formatNumber,
|
33
|
+
} from '../../utils/dataFormatters/dataFormatters';
|
30
34
|
import {DEFAULT_TABLE_SETTINGS} from '../../utils/constants';
|
31
35
|
import {useAutofetcher, useTypedSelector} from '../../utils/hooks';
|
32
36
|
import {clusterName} from '../../store';
|
@@ -25,6 +25,6 @@
|
|
25
25
|
"settings.enableAdditionalQueryModes.title": "Enable additional query modes",
|
26
26
|
"settings.enableAdditionalQueryModes.popover": "Adds 'Data', 'YQL - QueryService' and 'PostgreSQL' modes. May not work on some versions",
|
27
27
|
|
28
|
-
"settings.tenantDiagnostics.title": "
|
28
|
+
"settings.tenantDiagnostics.title": "Display metrics cards for database diagnostics",
|
29
29
|
"settings.tenantDiagnostics.popover": "Adds indicators of database resources usage. Incomplete data may be displayed for some databases"
|
30
30
|
}
|
@@ -25,6 +25,6 @@
|
|
25
25
|
"settings.enableAdditionalQueryModes.title": "Включить дополнительные режимы выполнения запросов",
|
26
26
|
"settings.enableAdditionalQueryModes.popover": "Добавляет режимы 'Data', 'YQL - QueryService' и 'PostgreSQL'. Может работать некорректно на некоторых версиях",
|
27
27
|
|
28
|
-
"settings.tenantDiagnostics.title": "
|
28
|
+
"settings.tenantDiagnostics.title": "Показывать карточки с метриками в диагностике базы данных",
|
29
29
|
"settings.tenantDiagnostics.popover": "Добавляет индикаторы использования ресурсов базы данных. Для некоторых баз могут отображаться неполные данные"
|
30
30
|
}
|
@@ -5,7 +5,7 @@ import flaskIcon from '../../assets/icons/flask.svg';
|
|
5
5
|
|
6
6
|
import {
|
7
7
|
ENABLE_ADDITIONAL_QUERY_MODES,
|
8
|
-
|
8
|
+
DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS,
|
9
9
|
INVERTED_DISKS_KEY,
|
10
10
|
LANGUAGE_KEY,
|
11
11
|
THEME_KEY,
|
@@ -96,7 +96,7 @@ export const enableQueryModesForExplainSetting: SettingProps = {
|
|
96
96
|
helpPopoverContent: i18n('settings.enableAdditionalQueryModes.popover'),
|
97
97
|
};
|
98
98
|
export const enableNewTenantDiagnosticsDesign: SettingProps = {
|
99
|
-
settingKey:
|
99
|
+
settingKey: DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS,
|
100
100
|
title: i18n('settings.tenantDiagnostics.title'),
|
101
101
|
helpPopoverContent: i18n('settings.tenantDiagnostics.popover'),
|
102
102
|
};
|
@@ -3,10 +3,10 @@ import DataTable, {Column} from '@gravity-ui/react-data-table';
|
|
3
3
|
import type {PreparedClusterNode} from '../../../store/reducers/clusterNodes/types';
|
4
4
|
import {isUnavailableNode} from '../../../utils/nodes';
|
5
5
|
import {DEFAULT_TABLE_SETTINGS} from '../../../utils/constants';
|
6
|
-
import {formatBytes} from '../../../utils';
|
6
|
+
import {formatBytes} from '../../../utils/dataFormatters/dataFormatters';
|
7
7
|
import {getDefaultNodePath} from '../../Node/NodePages';
|
8
8
|
|
9
|
-
import ProgressViewer from '../../../components/ProgressViewer/ProgressViewer';
|
9
|
+
import {ProgressViewer} from '../../../components/ProgressViewer/ProgressViewer';
|
10
10
|
import {PoolsGraph} from '../../../components/PoolsGraph/PoolsGraph';
|
11
11
|
import EntityStatus from '../../../components/EntityStatus/EntityStatus';
|
12
12
|
|
@@ -94,6 +94,7 @@ const columns: Column<PreparedClusterNode>[] = [
|
|
94
94
|
<ProgressViewer
|
95
95
|
value={row.LoadAverage[0]}
|
96
96
|
percents={true}
|
97
|
+
capacity={100}
|
97
98
|
colorizeProgress={true}
|
98
99
|
/>
|
99
100
|
) : (
|
package/dist/services/api.ts
CHANGED
@@ -352,7 +352,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
|
|
352
352
|
}
|
353
353
|
getHealthcheckInfo(database: string, {concurrentId}: AxiosOptions = {}) {
|
354
354
|
return this.get<HealthCheckAPIResponse>(
|
355
|
-
this.getPath('/viewer/json/healthcheck'),
|
355
|
+
this.getPath('/viewer/json/healthcheck?merge_records=true'),
|
356
356
|
{tenant: database},
|
357
357
|
{concurrentId},
|
358
358
|
);
|
@@ -5,7 +5,7 @@ import {createRequestActionTypes, createApiRequest} from '../../utils';
|
|
5
5
|
import type {ClusterNodesAction, ClusterNodesState, PreparedClusterNode} from './types';
|
6
6
|
|
7
7
|
import '../../../services/api';
|
8
|
-
import {calcUptime} from '../../../utils';
|
8
|
+
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
|
9
9
|
|
10
10
|
export const FETCH_CLUSTER_NODES = createRequestActionTypes('cluster', 'FETCH_CLUSTER_NODES');
|
11
11
|
|
@@ -5,6 +5,7 @@ import cluster from './cluster/cluster';
|
|
5
5
|
import clusterNodes from './clusterNodes/clusterNodes';
|
6
6
|
import tenant from './tenant/tenant';
|
7
7
|
import storage from './storage/storage';
|
8
|
+
import topStorageGroups from './tenantOverview/topStorageGroups/topStorageGroups';
|
8
9
|
import node from './node/node';
|
9
10
|
import tooltip from './tooltip';
|
10
11
|
import tablets from './tablets';
|
@@ -26,6 +27,7 @@ import nodesList from './nodesList';
|
|
26
27
|
import describe from './describe';
|
27
28
|
import schemaAcl from './schemaAcl/schemaAcl';
|
28
29
|
import executeTopQueries from './executeTopQueries';
|
30
|
+
import executeTopTables from './tenantOverview/executeTopTables/executeTopTables';
|
29
31
|
import healthcheckInfo from './healthcheckInfo';
|
30
32
|
import shardsWorkload from './shardsWorkload';
|
31
33
|
import hotKeys from './hotKeys';
|
@@ -43,6 +45,7 @@ export const rootReducer = {
|
|
43
45
|
clusterNodes,
|
44
46
|
tenant,
|
45
47
|
storage,
|
48
|
+
topStorageGroups,
|
46
49
|
node,
|
47
50
|
tooltip,
|
48
51
|
tablets,
|
@@ -65,6 +68,7 @@ export const rootReducer = {
|
|
65
68
|
describe,
|
66
69
|
schemaAcl,
|
67
70
|
executeTopQueries,
|
71
|
+
executeTopTables,
|
68
72
|
healthcheckInfo,
|
69
73
|
shardsWorkload,
|
70
74
|
hotKeys,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import {Selector, createSelector} from 'reselect';
|
2
2
|
|
3
3
|
import {EFlag} from '../../../types/api/enums';
|
4
|
-
import {calcUptimeInSeconds} from '../../../utils';
|
4
|
+
import {calcUptimeInSeconds} from '../../../utils/dataFormatters/dataFormatters';
|
5
5
|
import {HOUR_IN_SECONDS} from '../../../utils/constants';
|
6
6
|
import {NodesUptimeFilterValues} from '../../../utils/nodes';
|
7
7
|
import {prepareSearchValue} from '../../../utils/filters';
|
@@ -64,7 +64,7 @@ export interface NodesGeneralRequestParams extends NodesSortParams {
|
|
64
64
|
uptime?: number; // return nodes with less uptime in seconds
|
65
65
|
problems_only?: boolean; // return nodes with SystemState !== EFlag.Green
|
66
66
|
|
67
|
-
|
67
|
+
offset?: number;
|
68
68
|
limit?: number;
|
69
69
|
}
|
70
70
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type {TComputeInfo, TComputeNodeInfo} from '../../../types/api/compute';
|
2
2
|
import type {TNodesInfo} from '../../../types/api/nodes';
|
3
|
-
import {calcUptime} from '../../../utils';
|
3
|
+
import {calcUptime} from '../../../utils/dataFormatters/dataFormatters';
|
4
4
|
|
5
5
|
import type {NodesHandledResponse, NodesPreparedEntity} from './types';
|
6
6
|
|
@@ -15,7 +15,7 @@ import {
|
|
15
15
|
LAST_USED_QUERY_ACTION_KEY,
|
16
16
|
USE_BACKEND_PARAMS_FOR_TABLES_KEY,
|
17
17
|
LANGUAGE_KEY,
|
18
|
-
|
18
|
+
DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS,
|
19
19
|
} from '../../../utils/constants';
|
20
20
|
import '../../../services/api';
|
21
21
|
import {parseJson} from '../../../utils/utils';
|
@@ -50,14 +50,14 @@ export const initialState = {
|
|
50
50
|
[INVERTED_DISKS_KEY]: readSavedSettingsValue(INVERTED_DISKS_KEY, 'false'),
|
51
51
|
[USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY]: readSavedSettingsValue(
|
52
52
|
USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY,
|
53
|
-
'
|
53
|
+
'true',
|
54
54
|
),
|
55
55
|
[ENABLE_ADDITIONAL_QUERY_MODES]: readSavedSettingsValue(
|
56
56
|
ENABLE_ADDITIONAL_QUERY_MODES,
|
57
57
|
'false',
|
58
58
|
),
|
59
|
-
[
|
60
|
-
|
59
|
+
[DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS]: readSavedSettingsValue(
|
60
|
+
DISPLAY_METRICS_CARDS_FOR_TENANT_DIAGNOSTICS,
|
61
61
|
'false',
|
62
62
|
),
|
63
63
|
[SAVED_QUERIES_KEY]: readSavedSettingsValue(SAVED_QUERIES_KEY, '[]'),
|