File tree Expand file tree Collapse file tree 7 files changed +47
-13
lines changed
containers/Tenant/Diagnostics/TenantOverview Expand file tree Collapse file tree 7 files changed +47
-13
lines changed Original file line number Diff line number Diff line change @@ -40,23 +40,22 @@ export interface MemoryProgressViewerProps {
4040 stats : TMemoryStats ;
4141 className ?: string ;
4242 warningThreshold ?: number ;
43- value ?: number | string ;
44- capacity ?: number | string ;
4543 formatValues : FormatProgressViewerValues ;
4644 percents ?: boolean ;
4745 dangerThreshold ?: number ;
4846}
4947
5048export function MemoryViewer ( {
5149 stats,
52- value,
53- capacity,
5450 percents,
5551 formatValues,
5652 className,
5753 warningThreshold = 60 ,
5854 dangerThreshold = 80 ,
5955} : MemoryProgressViewerProps ) {
56+ const value = stats . AnonRss ;
57+ const capacity = stats . HardLimit ;
58+
6059 const theme = useTheme ( ) ;
6160 let fillWidth =
6261 Math . round ( ( parseFloat ( String ( value ) ) / parseFloat ( String ( capacity ) ) ) * 100 ) || 0 ;
Original file line number Diff line number Diff line change @@ -172,12 +172,7 @@ export function getMemoryColumn<
172172 defaultOrder : DataTable . DESCENDING ,
173173 render : ( { row} ) => {
174174 return row . MemoryStats ? (
175- < MemoryViewer
176- capacity = { row . MemoryLimit }
177- value = { row . MemoryStats . AnonRss }
178- formatValues = { formatStorageValuesToGb }
179- stats = { row . MemoryStats }
180- />
175+ < MemoryViewer formatValues = { formatStorageValuesToGb } stats = { row . MemoryStats } />
181176 ) : (
182177 < ProgressViewer
183178 value = { row . MemoryUsed }
Original file line number Diff line number Diff line change 11import React from 'react' ;
22
3+ import { MemoryViewer } from '../../../../../components/MemoryViewer/MemoryViewer' ;
4+ import { ProgressViewer } from '../../../../../components/ProgressViewer/ProgressViewer' ;
5+ import type { TMemoryStats } from '../../../../../types/api/nodes' ;
6+ import { formatStorageValuesToGb } from '../../../../../utils/dataFormatters/dataFormatters' ;
37import { TenantDashboard } from '../TenantDashboard/TenantDashboard' ;
8+ import { b } from '../utils' ;
49
510import { TopNodesByMemory } from './TopNodesByMemory' ;
611import { memoryDashboardConfig } from './memoryDashboardConfig' ;
712
813interface TenantMemoryProps {
914 tenantName : string ;
15+ memoryStats ?: TMemoryStats ;
16+ memoryUsed ?: string ;
17+ memoryLimit ?: string ;
1018}
1119
12- export function TenantMemory ( { tenantName} : TenantMemoryProps ) {
20+ export function TenantMemory ( {
21+ tenantName,
22+ memoryStats,
23+ memoryUsed,
24+ memoryLimit,
25+ } : TenantMemoryProps ) {
1326 return (
1427 < React . Fragment >
1528 < TenantDashboard database = { tenantName } charts = { memoryDashboardConfig } />
29+ < div className = { b ( 'title' ) } > { 'Memory details' } </ div >
30+ < div className = { b ( 'memory-info' ) } >
31+ { memoryStats ? (
32+ < MemoryViewer formatValues = { formatStorageValuesToGb } stats = { memoryStats } />
33+ ) : (
34+ < ProgressViewer
35+ value = { memoryUsed }
36+ capacity = { memoryLimit }
37+ formatValues = { formatStorageValuesToGb }
38+ colorizeProgress = { true }
39+ />
40+ ) }
41+ </ div >
1642 < TopNodesByMemory tenantName = { tenantName } />
1743 </ React . Fragment >
1844 ) ;
Original file line number Diff line number Diff line change 6363 & __storage-info {
6464 margin-bottom : 36px ;
6565 }
66+
67+ & __memory-info {
68+ width : 300px ;
69+ margin-bottom : 36px ;
70+ }
6671}
Original file line number Diff line number Diff line change @@ -123,7 +123,14 @@ export function TenantOverview({
123123 return < TenantStorage tenantName = { tenantName } metrics = { storageMetrics } /> ;
124124 }
125125 case TENANT_METRICS_TABS_IDS . memory : {
126- return < TenantMemory tenantName = { tenantName } /> ;
126+ return (
127+ < TenantMemory
128+ tenantName = { tenantName }
129+ memoryUsed = { tenantData . MemoryUsed }
130+ memoryLimit = { tenantData . MemoryLimit }
131+ memoryStats = { tenantData . MemoryStats }
132+ />
133+ ) ;
127134 }
128135 case TENANT_METRICS_TABS_IDS . healthcheck : {
129136 return < HealthcheckDetails tenantName = { tenantName } /> ;
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
202202 path,
203203 tablets : false ,
204204 storage : true ,
205+ memory : true ,
205206 } ,
206207 { concurrentId, requestConfig : { signal} } ,
207208 ) ;
Original file line number Diff line number Diff line change 11import type { EFlag } from './enums' ;
2- import type { TPoolStats , TSystemStateInfo } from './nodes' ;
2+ import type { TMemoryStats , TPoolStats , TSystemStateInfo } from './nodes' ;
33import type { TTabletStateInfo } from './tablet' ;
44
55/**
@@ -50,6 +50,7 @@ export interface TTenant {
5050 MemoryUsed ?: string ; // Actual memory consumption
5151 /** uint64 */
5252 MemoryLimit ?: string ;
53+ MemoryStats ?: TMemoryStats ;
5354 /** double */
5455 CoresUsed ?: number ; // Actual cpu consumption
5556 /** uint64 */
You can’t perform that action at this time.
0 commit comments