@@ -181,35 +181,35 @@ func (t *Task) Execute(ctx context.Context) error {
181181 t .logger .Errorf ("Transaction latency too high: %dmus (expected <= %dmus)" , avgLatency .Microseconds (), t .config .HighLatency )
182182 t .ctx .SetResult (types .TaskResultFailure )
183183 } else {
184- latenciesMus := make ([]int64 , len (latencies ))
185-
186- for i , latency := range latencies {
187- latenciesMus [i ] = latency .Microseconds ()
188- }
189-
190- plot , err := hdr .HdrPlot (latenciesMus )
191- if err != nil {
192- t .logger .Errorf ("Failed to generate HDR plot: %v" , err )
193- t .ctx .SetResult (types .TaskResultFailure )
194- return nil
195- }
196-
197- outputs := map [string ]interface {}{
198- "tx_count" : t .config .TxCount ,
199- "avg_latency_mus" : avgLatency .Microseconds (),
200- "tx_pool_latency_hdr_plot" : plot ,
201- "latencies" : latenciesMus ,
202- }
203-
204- outputsJSON , _ := json .Marshal (outputs )
205- t .logger .Infof ("outputs_json: %s" , string (outputsJSON ))
206-
207184 t .ctx .Outputs .SetVar ("tx_count" , t .config .TxCount )
208185 t .ctx .Outputs .SetVar ("avg_latency_mus" , avgLatency .Microseconds ())
209186 t .ctx .Outputs .SetVar ("detailed_latencies" , latencies )
210187
211188 t .ctx .SetResult (types .TaskResultSuccess )
212189 }
190+
191+ latenciesMus := make ([]int64 , len (latencies ))
192+
193+ for i , latency := range latencies {
194+ latenciesMus [i ] = latency .Microseconds ()
195+ }
196+
197+ plot , err := hdr .HdrPlot (latenciesMus )
198+ if err != nil {
199+ t .logger .Errorf ("Failed to generate HDR plot: %v" , err )
200+ t .ctx .SetResult (types .TaskResultFailure )
201+ return nil
202+ }
203+
204+ outputs := map [string ]interface {}{
205+ "tx_count" : t .config .TxCount ,
206+ "avg_latency_mus" : avgLatency .Microseconds (),
207+ "tx_pool_latency_hdr_plot" : plot ,
208+ "latencies" : latenciesMus ,
209+ }
210+
211+ outputsJSON , _ := json .Marshal (outputs )
212+ t .logger .Infof ("outputs_json: %s" , string (outputsJSON ))
213213
214214 return nil
215215}
0 commit comments