File tree Expand file tree Collapse file tree 1 file changed +15
-5
lines changed
chaos-runner/src/examples/java/io/synadia/examples Expand file tree Collapse file tree 1 file changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -69,15 +69,25 @@ public static void main(String[] args) throws Exception {
6969 int [] monitorPorts = runner .getMonitorPorts ();
7070 boolean hasMonitor = monitorPorts [0 ] > 0 ;
7171
72- String [] reports = new String [ports .length ];
72+ String [] hzs = new String [ports .length ];
7373 while (true ) {
7474 Thread .sleep (HEALTH_CHECK_DELAY );
7575 if (hasMonitor ) {
76- report ( "HealthZ" ) ;
76+ boolean changed = false ;
7777 for (int i = 0 ; i < monitorPorts .length ; i ++) {
78- int port = ports [i ];
79- int mport = monitorPorts [i ];
80- report (" " , port + "/" + mport , readHealthz (mport ));
78+ String hz = readHealthz (monitorPorts [i ]);
79+ if (!hz .equals (hzs [i ])) {
80+ changed = true ;
81+ hzs [i ] = hz ;
82+ }
83+ }
84+ if (changed ) {
85+ report ("HealthZ" );
86+ for (int i = 0 ; i < monitorPorts .length ; i ++) {
87+ int port = ports [i ];
88+ int mport = monitorPorts [i ];
89+ report (" " , port + "/" + mport , hzs [i ]);
90+ }
8191 }
8292 }
8393 }
You can’t perform that action at this time.
0 commit comments