import React from 'react'; import {Flex} from '@gravity-ui/uikit'; import {setTopQueriesFilters} from '../../../../../store/reducers/executeTopQueries/executeTopQueries'; import {TENANT_DIAGNOSTICS_TABS_IDS} from '../../../../../store/reducers/tenant/constants'; import type {ETenantType} from '../../../../../types/api/tenant'; import {EMPTY_DATA_PLACEHOLDER} from '../../../../../utils/constants'; import {useTypedDispatch} from '../../../../../utils/hooks'; import {useDiagnosticsPageLinkGetter} from '../../../Diagnostics/DiagnosticsPages'; import {MetricPageSummary} from '../MetricPageSummary/MetricPageSummary'; import {StatsWrapper} from '../StatsWrapper/StatsWrapper'; import {TenantDashboard} from '../TenantDashboard/TenantDashboard'; import i18n from '../i18n'; import type {TenantOverviewUsageMetric} from '../metricOverview'; import {TopNodesByCpu} from './TopNodesByCpu'; import {TopNodesByLoad} from './TopNodesByLoad'; import {TopQueries} from './TopQueries'; import {TopShards} from './TopShards'; import {cpuDashboardConfig} from './cpuDashboardConfig'; interface TenantCpuProps { database: string; databaseFullPath: string; databaseType?: ETenantType; metric?: TenantOverviewUsageMetric; } export function TenantCpu({database, databaseType, databaseFullPath, metric}: TenantCpuProps) { const dispatch = useTypedDispatch(); const getDiagnosticsPageLink = useDiagnosticsPageLinkGetter(); const allNodesLink = getDiagnosticsPageLink(TENANT_DIAGNOSTICS_TABS_IDS.nodes); const topShardsLink = getDiagnosticsPageLink(TENANT_DIAGNOSTICS_TABS_IDS.topShards); const topQueriesLink = getDiagnosticsPageLink(TENANT_DIAGNOSTICS_TABS_IDS.topQueries); const isServerless = databaseType === 'Serverless'; return ( {metric ? ( ) : null} {!isServerless && ( )} dispatch(setTopQueriesFilters({from: undefined, to: undefined})) } > ); }