File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -65,19 +65,25 @@ func (e *EngineController) logBlockProcessingMetrics(updateEngineFinish time.Tim
6565		return 
6666	}
6767
68- 	buildTime  :=  ev .InsertStarted .Sub (ev .BuildStarted )
68+ 	var  totalTime  time.Duration 
69+ 	var  buildTime  time.Duration 
6970	insertTime  :=  updateEngineFinish .Sub (ev .InsertStarted )
7071
71- 	var   totalTime  time. Duration 
72- 	if   ! ev . BuildStarted . IsZero () { 
73- 		totalTime   =   updateEngineFinish . Sub ( ev . BuildStarted ) 
74- 	}  else  { 
72+ 	if   ev . BuildStarted . IsZero () { 
73+ 		 //  BuildStarted may be zero if sequencer already built + gossiped a block, but failed during 
74+ 		// insertion and needed a retry of the insertion. 
75+ 		 buildTime   =   0 
7576		totalTime  =  insertTime 
77+ 	} else  {
78+ 		buildTime  =  ev .InsertStarted .Sub (ev .BuildStarted )
79+ 		totalTime  =  updateEngineFinish .Sub (ev .BuildStarted )
7680	}
7781
7882	// Protect against divide-by-zero 
7983	var  mgasps  float64 
8084	if  totalTime  >  0  {
85+ 		// Calculate "block-processing" mgasps. 
86+ 		// NOTE: "realtime" mgasps (chain throughput) is a different calculation: (GasUsed / blockPeriod) 
8187		mgasps  =  float64 (ev .Envelope .ExecutionPayload .GasUsed ) *  1000  /  float64 (totalTime )
8288	}
8389
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments