@@ -82,7 +82,8 @@ func TestPerformance(t *testing.T) {
8282 t .Fatalf ("test case %v failed" , tc .name )
8383 }
8484
85- // Calculate the test duration and push metrics if the test case succeeded.
85+ // Calculate the test duration and push metrics if the test case
86+ // succeeded.
8687 if cfg .PrometheusGateway .Enabled {
8788 duration := time .Since (startTime ).Seconds ()
8889
@@ -93,19 +94,22 @@ func TestPerformance(t *testing.T) {
9394 // Update the metric with the test duration.
9495 testDuration .WithLabelValues (label ).Set (duration )
9596
96- t .Logf ("Pushing testDuration %v with label %v to gateway" , duration , label )
97+ t .Logf ("Pushing testDuration %v with label %v to " +
98+ "gateway" , duration , label )
9799
98100 // Create a new pusher to push the metrics.
99- pusher := push .New (cfg .PrometheusGateway .PushURL , "load_test" ).
100- Collector (testDuration )
101+ pusher := push .New (
102+ cfg .PrometheusGateway .PushURL , "load_test" ,
103+ ).Collector (testDuration )
101104
102105 // Push the metrics to Prometheus PushGateway.
103106 if err := pusher .Add (); err != nil {
104- t .Logf ("Could not push metrics to Prometheus PushGateway: %v" ,
105- err )
107+ t .Logf ("Could not push metrics to Prometheus " +
108+ "PushGateway: %v" , err )
106109 } else {
107- t .Logf ("Metrics pushed for test case '%s': duration = %v seconds" ,
108- tc .name , duration )
110+ t .Logf ("Metrics pushed for test case '%s': " +
111+ "duration = %v seconds" , tc .name ,
112+ duration )
109113 }
110114 }
111115 }
0 commit comments