@@ -182,38 +182,40 @@ def print_all_errors():
182182
183183 if errors :
184184 print (f"🔧 { node_name } " )
185+
186+ # Group errors by type and count them
187+ error_counts = {}
188+
185189 for attempt_key , attempt_data in errors .items ():
186190 # Handle both old and new error formats
187191 if isinstance (attempt_data , dict ) and 'ka_label' in attempt_data :
188192 # New format with structured error data per attempt
189- ka_label = attempt_data .get ('ka_label' , 'Unknown KA' )
190- attempt_number = attempt_data .get ('attempt' , 1 )
191193 publish_error = attempt_data .get ('publish_error' )
192194 query_error = attempt_data .get ('query_error' )
193195 publisher_get_error = attempt_data .get ('publisher_get_error' )
194196 non_publisher_get_error = attempt_data .get ('non_publisher_get_error' )
195197
196- # Show actual error messages for each error type
197- error_lines = []
198+ # Count each error type
198199 if publish_error :
199- error_lines .append (f" • publishing — { publish_error } " )
200+ error_key = f"publishing — { publish_error } "
201+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
200202 if query_error :
201- error_lines .append (f" • querying — { query_error } " )
203+ error_key = f"querying — { query_error } "
204+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
202205 if publisher_get_error :
203- error_lines .append (f" • local get — { publisher_get_error } " )
206+ error_key = f"local get — { publisher_get_error } "
207+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
204208 if non_publisher_get_error :
205- error_lines .append (f" • remote get — { non_publisher_get_error } " )
206-
207- if error_lines :
208- print (f" • { ka_label } (attempt { attempt_number } ):" )
209- for line in error_lines :
210- print (line )
211- else :
212- print (f" • { ka_label } (attempt { attempt_number } ): no errors" )
209+ error_key = f"remote get — { non_publisher_get_error } "
210+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
213211 else :
214212 # Old format - simple count
215213 count = attempt_data if isinstance (attempt_data , int ) else 1
216214 print (f" • { count } x { attempt_key } " )
215+
216+ # Print summed up errors
217+ for error_type , count in error_counts .items ():
218+ print (f" • { count } x { error_type } " )
217219 print ()
218220 else :
219221 print (f"✅ { node_name } : No errors\n " )
@@ -231,34 +233,36 @@ def print_error_for_node():
231233 if not errors :
232234 print (" ✅ No errors\n " )
233235 else :
236+ # Group errors by type and count them
237+ error_counts = {}
238+
234239 for attempt_key , attempt_data in errors .items ():
235240 if isinstance (attempt_data , dict ) and 'ka_label' in attempt_data :
236- ka_label = attempt_data .get ('ka_label' , 'Unknown KA' )
237- attempt_number = attempt_data .get ('attempt' , 1 )
238241 publish_error = attempt_data .get ('publish_error' )
239242 query_error = attempt_data .get ('query_error' )
240243 publisher_get_error = attempt_data .get ('publisher_get_error' )
241244 non_publisher_get_error = attempt_data .get ('non_publisher_get_error' )
242245
243- error_lines = []
246+ # Count each error type
244247 if publish_error :
245- error_lines .append (f" • publishing — { publish_error } " )
248+ error_key = f"publishing — { publish_error } "
249+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
246250 if query_error :
247- error_lines .append (f" • querying — { query_error } " )
251+ error_key = f"querying — { query_error } "
252+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
248253 if publisher_get_error :
249- error_lines .append (f" • local get — { publisher_get_error } " )
254+ error_key = f"local get — { publisher_get_error } "
255+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
250256 if non_publisher_get_error :
251- error_lines .append (f" • remote get — { non_publisher_get_error } " )
252-
253- if error_lines :
254- print (f" • { ka_label } (attempt { attempt_number } ):" )
255- for line in error_lines :
256- print (line )
257- else :
258- print (f" • { ka_label } (attempt { attempt_number } ): no errors" )
257+ error_key = f"remote get — { non_publisher_get_error } "
258+ error_counts [error_key ] = error_counts .get (error_key , 0 ) + 1
259259 else :
260260 count = attempt_data if isinstance (attempt_data , int ) else 1
261261 print (f" • { count } x { attempt_key } " )
262+
263+ # Print summed up errors
264+ for error_type , count in error_counts .items ():
265+ print (f" • { count } x { error_type } " )
262266 print ()
263267
264268if __name__ == "__main__" :
0 commit comments