File tree 7 files changed +47
-13
lines changed
containers/Tenant/Diagnostics/TenantOverview
7 files changed +47
-13
lines changed Original file line number Diff line number Diff line change @@ -40,23 +40,22 @@ export interface MemoryProgressViewerProps {
40
40
stats : TMemoryStats ;
41
41
className ?: string ;
42
42
warningThreshold ?: number ;
43
- value ?: number | string ;
44
- capacity ?: number | string ;
45
43
formatValues : FormatProgressViewerValues ;
46
44
percents ?: boolean ;
47
45
dangerThreshold ?: number ;
48
46
}
49
47
50
48
export function MemoryViewer ( {
51
49
stats,
52
- value,
53
- capacity,
54
50
percents,
55
51
formatValues,
56
52
className,
57
53
warningThreshold = 60 ,
58
54
dangerThreshold = 80 ,
59
55
} : MemoryProgressViewerProps ) {
56
+ const value = stats . AnonRss ;
57
+ const capacity = stats . HardLimit ;
58
+
60
59
const theme = useTheme ( ) ;
61
60
let fillWidth =
62
61
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<
172
172
defaultOrder : DataTable . DESCENDING ,
173
173
render : ( { row} ) => {
174
174
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 } />
181
176
) : (
182
177
< ProgressViewer
183
178
value = { row . MemoryUsed }
Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
2
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' ;
3
7
import { TenantDashboard } from '../TenantDashboard/TenantDashboard' ;
8
+ import { b } from '../utils' ;
4
9
5
10
import { TopNodesByMemory } from './TopNodesByMemory' ;
6
11
import { memoryDashboardConfig } from './memoryDashboardConfig' ;
7
12
8
13
interface TenantMemoryProps {
9
14
tenantName : string ;
15
+ memoryStats ?: TMemoryStats ;
16
+ memoryUsed ?: string ;
17
+ memoryLimit ?: string ;
10
18
}
11
19
12
- export function TenantMemory ( { tenantName} : TenantMemoryProps ) {
20
+ export function TenantMemory ( {
21
+ tenantName,
22
+ memoryStats,
23
+ memoryUsed,
24
+ memoryLimit,
25
+ } : TenantMemoryProps ) {
13
26
return (
14
27
< React . Fragment >
15
28
< 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 >
16
42
< TopNodesByMemory tenantName = { tenantName } />
17
43
</ React . Fragment >
18
44
) ;
Original file line number Diff line number Diff line change 63
63
& __storage-info {
64
64
margin-bottom : 36px ;
65
65
}
66
+
67
+ & __memory-info {
68
+ width : 300px ;
69
+ margin-bottom : 36px ;
70
+ }
66
71
}
Original file line number Diff line number Diff line change @@ -123,7 +123,14 @@ export function TenantOverview({
123
123
return < TenantStorage tenantName = { tenantName } metrics = { storageMetrics } /> ;
124
124
}
125
125
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
+ ) ;
127
134
}
128
135
case TENANT_METRICS_TABS_IDS . healthcheck : {
129
136
return < HealthcheckDetails tenantName = { tenantName } /> ;
Original file line number Diff line number Diff line change @@ -202,6 +202,7 @@ export class YdbEmbeddedAPI extends AxiosWrapper {
202
202
path,
203
203
tablets : false ,
204
204
storage : true ,
205
+ memory : true ,
205
206
} ,
206
207
{ concurrentId, requestConfig : { signal} } ,
207
208
) ;
Original file line number Diff line number Diff line change 1
1
import type { EFlag } from './enums' ;
2
- import type { TPoolStats , TSystemStateInfo } from './nodes' ;
2
+ import type { TMemoryStats , TPoolStats , TSystemStateInfo } from './nodes' ;
3
3
import type { TTabletStateInfo } from './tablet' ;
4
4
5
5
/**
@@ -50,6 +50,7 @@ export interface TTenant {
50
50
MemoryUsed ?: string ; // Actual memory consumption
51
51
/** uint64 */
52
52
MemoryLimit ?: string ;
53
+ MemoryStats ?: TMemoryStats ;
53
54
/** double */
54
55
CoresUsed ?: number ; // Actual cpu consumption
55
56
/** uint64 */
You can’t perform that action at this time.
0 commit comments