File tree Expand file tree Collapse file tree 5 files changed +26
-17
lines changed Expand file tree Collapse file tree 5 files changed +26
-17
lines changed Original file line number Diff line number Diff line change @@ -135,13 +135,18 @@ const TransferColumns = React.memo(() => {
135
135
136
136
}
137
137
else {
138
+ console . log ( "healthData in else:" , healthDataList . length ) ;
139
+ console . log ( "eventData in else:" , eventDataList . length ) ;
138
140
if ( healthDataList && healthDataList . length > 0 && eventDataList && eventDataList . length > 0 ) {
141
+ console . log ( "eventDataList:" , eventDataList . length ) ;
142
+ console . log ( "healthDataList" , healthDataList . length ) ;
139
143
setMetricsPool ( getMetrics ( 'event' , eventDataList ) . concat ( getMetrics ( 'health' , healthDataList ) ) ) ;
140
144
}
141
- else {
145
+ else if ( healthMetricsReady && eventMetricsReady ) {
142
146
console . log ( "set concat metrics:" , JSON . stringify ( eventMetrics . concat ( healthMetrics ) ) ) ;
143
147
setMetricsPool ( eventMetrics . concat ( healthMetrics ) ) ;
144
148
}
149
+ console . log ( "here" ) ;
145
150
146
151
147
152
}
Original file line number Diff line number Diff line change @@ -66,21 +66,27 @@ const GraphsContainer: React.FC<GraphsContainerProps> = React.memo(props => {
66
66
67
67
useEffect ( ( ) => {
68
68
const serviceArray = service . split ( ' ' ) ;
69
-
70
-
69
+ const healthServiceArray = serviceArray . filter ( ( value : string ) => value !== 'kafkametrics' ) ;
70
+ // console.log("service array:", JSON.stringify(serviceArray));
71
+ // console.log("health service array:", JSON.stringify(healthServiceArray));
71
72
if ( live ) {
72
73
setIntervalID (
73
74
setInterval ( ( ) => {
74
75
fetchCommsData ( app , live ) ;
75
- fetchHealthData ( serviceArray ) ;
76
- fetchEventData ( serviceArray [ 0 ] ) ;
76
+ fetchHealthData ( healthServiceArray ) ;
77
+ if ( service . includes ( 'kafkametrics' ) ) {
78
+ fetchEventData ( 'kafkametrics' ) ;
79
+ }
80
+
77
81
} , 3000 )
78
82
) ;
79
83
} else {
80
84
if ( intervalID ) clearInterval ( intervalID ) ;
81
85
fetchCommsData ( app , live ) ;
82
- fetchHealthData ( serviceArray ) ;
83
- fetchEventData ( serviceArray [ 0 ] ) ;
86
+ fetchHealthData ( healthServiceArray ) ;
87
+ if ( service . includes ( 'kafkametrics' ) ) {
88
+ fetchEventData ( ) ;
89
+ }
84
90
}
85
91
86
92
return ( ) => {
Original file line number Diff line number Diff line change @@ -19,7 +19,7 @@ const EventContextProvider: React.FC = React.memo(({ children }) => {
19
19
20
20
function tryParseJSON ( jsonString : any ) {
21
21
try {
22
- // console.log("jsonString at EventContext:", jsonString);
22
+ console . log ( "jsonString at EventContext:" , jsonString ) ;
23
23
const o = JSON . parse ( jsonString ) ;
24
24
if ( o && typeof o === 'object' ) {
25
25
return true ;
@@ -30,8 +30,8 @@ const EventContextProvider: React.FC = React.memo(({ children }) => {
30
30
return false ;
31
31
}
32
32
33
- const fetchEventData = useCallback ( ( serv ) => {
34
- if ( serv === 'kafkametrics' ) {
33
+ const fetchEventData = useCallback ( ( ) => {
34
+ // if(serv === 'kafkametrics'){
35
35
// console.log("in fetchEventData in EventContext!!");
36
36
ipcRenderer . removeAllListeners ( 'kafkaResponse' ) ;
37
37
ipcRenderer . send ( 'kafkaRequest' ) ;
@@ -49,7 +49,7 @@ const EventContextProvider: React.FC = React.memo(({ children }) => {
49
49
50
50
} ) ;
51
51
52
- }
52
+ // }
53
53
54
54
55
55
} , [ ] ) ;
Original file line number Diff line number Diff line change @@ -18,8 +18,6 @@ export const HealthContext = React.createContext<any>(null);
18
18
const HealthContextProvider : React . FC = React . memo ( ( { children } ) => {
19
19
const [ healthData , setHealthData ] = useState < any > ( { "healthDataList" :[ ] , "healthTimeList" :[ ] } ) ;
20
20
const [ services , setServices ] = useState < Array < string > > ( [ ] ) ;
21
- // const [datalist, setDataList] = useState<Array<any>>([]);
22
- // const [timelist, setTimeList] = useState<Array<any>>([]);
23
21
24
22
function tryParseJSON ( jsonString : any ) {
25
23
try {
@@ -36,7 +34,7 @@ const HealthContextProvider: React.FC = React.memo(({ children }) => {
36
34
}
37
35
38
36
const fetchHealthData = useCallback ( serv => {
39
- //setServices(serv);
37
+
40
38
ipcRenderer . removeAllListeners ( 'healthResponse' ) ;
41
39
42
40
let temp : any [ ] = [ ] ;
@@ -63,10 +61,10 @@ const HealthContextProvider: React.FC = React.memo(({ children }) => {
63
61
} ) ;
64
62
65
63
} ) . then ( ( dt : any ) => {
66
- if ( service !== 'kafkametrics' ) {
64
+
67
65
temp . push ( dt ) ;
68
66
// console.log("temp is:", JSON.stringify(temp));
69
- }
67
+
70
68
if ( checkServicesComplete ( temp , serv ) ) {
71
69
72
70
setServices ( serv ) ;
Original file line number Diff line number Diff line change 1
- hostPort : 9000
1
+ hostPort : localhost: 9000
2
2
lowercaseOutputName : true
3
3
rules :
4
4
- pattern : kafka.server<type=ReplicaManager, name=UnderReplicatedPartitions><>Value
You can’t perform that action at this time.
0 commit comments