@@ -144,6 +144,8 @@ fd_gui_new( void * shmem,
144144 for ( ulong i = 0UL ; i < (FD_GUI_REPAIR_SLOT_HISTORY_SZ + 1UL ); i ++ ) gui -> summary .slots_max_repair [ i ].slot = ULONG_MAX ;
145145 for ( ulong i = 0UL ; i < (FD_GUI_TURBINE_SLOT_HISTORY_SZ + 1UL ); i ++ ) gui -> summary .slots_max_turbine [ i ].slot = ULONG_MAX ;
146146
147+ for ( ulong i = 0UL ; i < FD_GUI_TURBINE_RECV_TIMESTAMPS ; i ++ ) gui -> turbine_slots [ i ].slot = ULONG_MAX ;
148+
147149 gui -> summary .estimated_tps_history_idx = 0UL ;
148150 memset ( gui -> summary .estimated_tps_history , 0 , sizeof (gui -> summary .estimated_tps_history ) );
149151
@@ -1848,6 +1850,28 @@ fd_gui_handle_shred( fd_gui_t * gui,
18481850 fd_gui_printf_turbine_slot ( gui );
18491851 fd_http_server_ws_broadcast ( gui -> http );
18501852
1853+ gui -> turbine_slots [ slot % FD_GUI_TURBINE_RECV_TIMESTAMPS ].slot = slot ;
1854+ gui -> turbine_slots [ slot % FD_GUI_TURBINE_RECV_TIMESTAMPS ].timestamp = tsorig ;
1855+
1856+ ulong duration_sum = 0UL ;
1857+ ulong slot_cnt = 0UL ;
1858+
1859+ for ( ulong i = 0UL ; i < FD_GUI_TURBINE_RECV_TIMESTAMPS ; i ++ ) {
1860+ fd_gui_turbine_slot_t * cur = & gui -> turbine_slots [ i ];
1861+ fd_gui_turbine_slot_t * prev = & gui -> turbine_slots [ (i + FD_GUI_TURBINE_RECV_TIMESTAMPS - 1UL ) % FD_GUI_TURBINE_RECV_TIMESTAMPS ];
1862+ if ( FD_UNLIKELY ( cur -> slot == ULONG_MAX || prev -> slot == ULONG_MAX || cur -> slot != prev -> slot + 1UL ) ) continue ;
1863+
1864+ long slot_duration = cur -> timestamp - prev -> timestamp ;
1865+ duration_sum += (ulong )fd_long_max ( slot_duration , 0UL );
1866+ slot_cnt ++ ;
1867+ }
1868+
1869+ if ( FD_LIKELY ( slot_cnt > 0 ) ) {
1870+ gui -> summary .estimated_slot_duration_nanos = (ulong )(duration_sum / slot_cnt );
1871+ fd_gui_printf_estimated_slot_duration_nanos ( gui );
1872+ fd_http_server_ws_broadcast ( gui -> http );
1873+ }
1874+
18511875 if ( FD_UNLIKELY ( gui -> summary .slot_caught_up == ULONG_MAX ) ) fd_gui_try_insert_catch_up_slot ( gui -> summary .catch_up_turbine , FD_GUI_TURBINE_CATCH_UP_HISTORY_SZ , & gui -> summary .catch_up_turbine_sz , slot );
18521876 }
18531877
@@ -2037,7 +2061,7 @@ fd_gui_handle_reset_slot_legacy( fd_gui_t * gui,
20372061 }
20382062 }
20392063
2040- if ( FD_LIKELY ( slot_cnt > 0 )) {
2064+ if ( FD_LIKELY ( slot_cnt > 0 ) ) {
20412065 gui -> summary .estimated_slot_duration_nanos = (ulong )(duration_sum / slot_cnt );
20422066 fd_gui_printf_estimated_slot_duration_nanos ( gui );
20432067 fd_http_server_ws_broadcast ( gui -> http );
0 commit comments