@@ -19,9 +19,11 @@ import {calculateMetricAggregates} from '../../../../../utils/metrics';
1919// no direct legend formatters needed here – handled in subcomponents
2020import { TenantTabsGroups , getTenantPath } from '../../../TenantPages' ;
2121
22- import { CommonMetricsTabs } from './CommonMetricsTabs' ;
23- import { DedicatedMetricsTabs } from './DedicatedMetricsTabs' ;
24- import { ServerlessPlaceholderTabs } from './ServerlessPlaceholderTabs' ;
22+ import { CpuTab } from './components/CpuTab' ;
23+ import { MemoryTab } from './components/MemoryTab' ;
24+ import { NetworkTab } from './components/NetworkTab' ;
25+ import { PlaceholderTab } from './components/PlaceholderTab' ;
26+ import { StorageTab } from './components/StorageTab' ;
2527
2628import './MetricsTabs.scss' ;
2729
@@ -32,7 +34,8 @@ interface MetricsTabsProps {
3234 memoryStats ?: TenantMetricStats [ ] ;
3335 blobStorageStats ?: TenantStorageStats [ ] ;
3436 tabletStorageStats ?: TenantStorageStats [ ] ;
35- networkStats ?: TenantMetricStats [ ] ;
37+ networkUtilization ?: number ;
38+ networkThroughput ?: number ;
3639 storageGroupsCount ?: number ;
3740 databaseType ?: ETenantType ;
3841 activeTab : TenantMetricsTab ;
@@ -43,7 +46,8 @@ export function MetricsTabs({
4346 memoryStats,
4447 blobStorageStats,
4548 tabletStorageStats,
46- networkStats,
49+ networkUtilization,
50+ networkThroughput,
4751 storageGroupsCount,
4852 databaseType,
4953 activeTab,
@@ -88,42 +92,51 @@ export function MetricsTabs({
8892 // Calculate memory metrics using utility
8993 const memoryMetrics = useMemo ( ( ) => calculateMetricAggregates ( memoryStats ) , [ memoryStats ] ) ;
9094
91- // Calculate network metrics using utility
95+ // Pass raw network values; DedicatedMetricsTabs computes percent and legend
9296 const [ showNetworkUtilization ] = useSetting < boolean > ( SHOW_NETWORK_UTILIZATION ) ;
93- const networkMetrics = useMemo (
94- ( ) => ( networkStats ? calculateMetricAggregates ( networkStats ) : null ) ,
95- [ networkStats ] ,
96- ) ;
9797
9898 // card variant is handled within subcomponents
9999
100100 const isServerless = databaseType === 'Serverless' ;
101101
102102 return (
103103 < Flex className = { b ( { serverless : Boolean ( isServerless ) } ) } alignItems = "center" >
104- < CommonMetricsTabs
105- activeTab = { activeTab }
106- tabLinks = { tabLinks }
104+ < CpuTab
105+ to = { tabLinks [ TENANT_METRICS_TABS_IDS . cpu ] }
106+ active = { activeTab === TENANT_METRICS_TABS_IDS . cpu }
107+ isServerless = { Boolean ( isServerless ) }
107108 cpu = { { totalUsed : cpuMetrics . totalUsed , totalLimit : cpuMetrics . totalLimit } }
109+ />
110+ < StorageTab
111+ to = { tabLinks [ TENANT_METRICS_TABS_IDS . storage ] }
112+ active = { activeTab === TENANT_METRICS_TABS_IDS . storage }
113+ isServerless = { Boolean ( isServerless ) }
108114 storage = { {
109115 totalUsed : storageMetrics . totalUsed ,
110116 totalLimit : storageMetrics . totalLimit ,
111117 } }
112118 storageGroupsCount = { storageGroupsCount }
113- databaseType = { databaseType }
114119 />
115120 { isServerless ? (
116- < ServerlessPlaceholderTabs />
121+ < PlaceholderTab />
117122 ) : (
118- < DedicatedMetricsTabs
119- activeTab = { activeTab }
120- tabLinks = { tabLinks }
123+ < MemoryTab
124+ to = { tabLinks [ TENANT_METRICS_TABS_IDS . memory ] }
125+ active = { activeTab === TENANT_METRICS_TABS_IDS . memory }
121126 memory = { {
122127 totalUsed : memoryMetrics . totalUsed ,
123128 totalLimit : memoryMetrics . totalLimit ,
124129 } }
125- network = { networkMetrics }
126- showNetwork = { Boolean ( showNetworkUtilization && networkStats && networkMetrics ) }
130+ />
131+ ) }
132+ { isServerless || ! showNetworkUtilization ? (
133+ < PlaceholderTab />
134+ ) : (
135+ < NetworkTab
136+ to = { tabLinks [ TENANT_METRICS_TABS_IDS . network ] }
137+ active = { activeTab === TENANT_METRICS_TABS_IDS . network }
138+ networkUtilization = { networkUtilization }
139+ networkThroughput = { networkThroughput }
127140 />
128141 ) }
129142 </ Flex >
0 commit comments