File tree Expand file tree Collapse file tree 5 files changed +17
-22
lines changed Expand file tree Collapse file tree 5 files changed +17
-22
lines changed Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ $memory-type-colors: (
2626
2727 overflow : hidden ;
2828
29- height : 23 px ;
29+ height : 20 px ;
3030
3131 border-radius : 2px ;
3232 background : var (--g-color-base-generic );
@@ -96,15 +96,6 @@ $memory-type-colors: (
9696 }
9797 }
9898
99- & _size {
100- height : 20px ;
101- @include body-2-typography ();
102-
103- #{$block } __progress-container {
104- height : inherit ;
105- }
106- }
107-
10899 & __text {
109100 display : flex ;
110101 justify-content : center ;
Original file line number Diff line number Diff line change 11import { DefinitionList , useTheme } from '@gravity-ui/uikit' ;
22
33import type { TMemoryStats } from '../../types/api/nodes' ;
4+ import { formatBytes } from '../../utils/bytesParsers' ;
45import { cn } from '../../utils/cn' ;
56import { calculateProgressStatus } from '../../utils/progress' ;
67import { isNumeric } from '../../utils/utils' ;
@@ -71,14 +72,8 @@ export function MemoryViewer({
7172
7273 const memorySegments = getMemorySegments ( stats ) ;
7374
74- const totalUsedMemory =
75- memorySegments
76- . filter ( ( { isInfo} ) => ! isInfo )
77- . reduce ( ( acc , segment ) => acc + calculateMemoryShare ( segment . value ) , 0 ) /
78- parseFloat ( String ( capacity ) ) ;
79-
8075 const status = calculateProgressStatus ( {
81- fillWidth : totalUsedMemory ,
76+ fillWidth,
8277 warningThreshold,
8378 dangerThreshold,
8479 colorizeProgress : true ,
@@ -109,7 +104,12 @@ export function MemoryViewer({
109104 colorizeProgress
110105 />
111106 ) : (
112- formatValues ( segmentSize , undefined ) [ 0 ]
107+ formatBytes ( {
108+ value : segmentSize ,
109+ size : 'gb' ,
110+ withSizeLabel : true ,
111+ precision : 2 ,
112+ } )
113113 ) }
114114 </ DefinitionList . Item >
115115 ) ,
Original file line number Diff line number Diff line change 11{
2- "text_memory-detailed" : " Memory Detailed" ,
32 "text_external-consumption" : " External Consumption" ,
43 "text_allocator-caches" : " Allocator Caches" ,
54 "text_shared-cache" : " Shared Cache" ,
65 "text_memtable" : " MemTable" ,
76 "text_query-execution" : " Query Execution" ,
7+ "text_usage" : " Usage" ,
88 "text_soft-limit" : " Soft Limit" ,
99 "text_hard-limit" : " Hard Limit" ,
10- "text_other" : " Other" ,
11- "memory-detailed" : " Memory Detailed"
10+ "text_other" : " Other"
1211}
Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ export function getMemorySegments(stats: TMemoryStats): MemorySegment[] {
7171 value : getMaybeNumber ( stats . ExternalConsumption ) ,
7272 isInfo : true ,
7373 } ,
74+ {
75+ label : i18n ( 'text_usage' ) ,
76+ key : 'Usage' ,
77+ value : getMaybeNumber ( stats . AnonRss ) ,
78+ isInfo : true ,
79+ } ,
7480 {
7581 label : i18n ( 'text_soft-limit' ) ,
7682 key : 'SoftLimit' ,
Original file line number Diff line number Diff line change 1515 "disk-usage" : " Disk usage" ,
1616 "tablets" : " Tablets" ,
1717 "load-average" : " Load Average" ,
18- "memory-detailed" : " Memory Detailed" ,
1918 "load" : " Load" ,
2019 "caches" : " Caches" ,
2120 "sessions" : " Sessions" ,
You can’t perform that action at this time.
0 commit comments