@@ -13,10 +13,6 @@ import {getDefaultNodePath} from '../../../../Node/NodePages';
13
13
14
14
import { TOP_SHARDS_COLUMNS_IDS , TOP_SHARDS_COLUMNS_TITLES } from './constants' ;
15
15
16
- function prepareCPUWorkloadValue ( value : string | number ) {
17
- return `${ roundToPrecision ( Number ( value ) * 100 , 2 ) } %` ;
18
- }
19
-
20
16
const getPathColumn = ( schemaPath : string , location : Location ) : Column < KeyValueRow > => ( {
21
17
name : TOP_SHARDS_COLUMNS_IDS . Path ,
22
18
header : TOP_SHARDS_COLUMNS_TITLES . Path ,
@@ -32,15 +28,6 @@ const getPathColumn = (schemaPath: string, location: Location): Column<KeyValueR
32
28
width : 300 ,
33
29
} ) ;
34
30
35
- const cpuCoresColumn : Column < KeyValueRow > = {
36
- name : TOP_SHARDS_COLUMNS_IDS . CPUCores ,
37
- header : TOP_SHARDS_COLUMNS_TITLES . CPUCores ,
38
- render : ( { row} ) => {
39
- return prepareCPUWorkloadValue ( row . CPUCores || 0 ) ;
40
- } ,
41
- align : DataTable . RIGHT ,
42
- } ;
43
-
44
31
const dataSizeColumn : Column < KeyValueRow > = {
45
32
name : TOP_SHARDS_COLUMNS_IDS . DataSize ,
46
33
header : TOP_SHARDS_COLUMNS_TITLES . DataSize ,
@@ -75,21 +62,17 @@ const nodeIdColumn: Column<KeyValueRow> = {
75
62
align : DataTable . RIGHT ,
76
63
} ;
77
64
78
- const topShardsCpuCoresColumn : Column < KeyValueRow > = {
65
+ const cpuCoresColumn : Column < KeyValueRow > = {
79
66
name : TOP_SHARDS_COLUMNS_IDS . CPUCores ,
80
67
header : TOP_SHARDS_COLUMNS_TITLES . CPUCores ,
81
68
render : ( { row} ) => {
82
- return (
83
- < UsageLabel
84
- value = { roundToPrecision ( Number ( row . CPUCores ) * 100 , 2 ) }
85
- theme = { getUsageSeverity ( Number ( row . CPUCores ) * 100 ) }
86
- />
87
- ) ;
69
+ const usage = Number ( row . CPUCores ) * 100 || 0 ;
70
+
71
+ return < UsageLabel value = { roundToPrecision ( usage , 2 ) } theme = { getUsageSeverity ( usage ) } /> ;
88
72
} ,
89
73
align : DataTable . RIGHT ,
90
- sortable : false ,
91
- width : 140 ,
92
- resizeMinWidth : 140 ,
74
+ width : 110 ,
75
+ resizeMinWidth : 110 ,
93
76
} ;
94
77
95
78
const inFlightTxCountColumn : Column < KeyValueRow > = {
@@ -111,5 +94,5 @@ export const getShardsWorkloadColumns = (schemaPath: string, location: Location)
111
94
} ;
112
95
113
96
export const getTopShardsColumns = ( schemaPath : string , location : Location ) => {
114
- return [ tabletIdColumn , getPathColumn ( schemaPath , location ) , topShardsCpuCoresColumn ] ;
97
+ return [ tabletIdColumn , getPathColumn ( schemaPath , location ) , cpuCoresColumn ] ;
115
98
} ;
0 commit comments