diff --git a/itest/loadtest/config.go b/itest/loadtest/config.go index 61d6f58ad..fdc0d02ea 100644 --- a/itest/loadtest/config.go +++ b/itest/loadtest/config.go @@ -60,16 +60,18 @@ type BitcoinConfig struct { // PrometheusGatewayConfig defines exported config options for connecting to the // Prometheus PushGateway. +// +//nolint:lll type PrometheusGatewayConfig struct { - // nolint: lll - Enabled bool `long:"enabled" description:"Enable pushing metrics to Prometheus PushGateway"` - // nolint: lll + Enabled bool `long:"enabled" description:"Enable pushing metrics to Prometheus PushGateway"` Host string `long:"host" description:"Prometheus PushGateway host address"` Port int `long:"port" description:"Prometheus PushGateway port"` PushURL string } // Config holds the main configuration for the performance testing binary. +// +//nolint:lll type Config struct { // TestCases is a comma separated list of test cases that will be // executed. @@ -111,8 +113,6 @@ type Config struct { // PrometheusGateway is the configuration for the Prometheus // PushGateway. - // - // nolint: lll PrometheusGateway *PrometheusGatewayConfig `group:"prometheus-gateway" namespace:"prometheus-gateway" description:"Prometheus PushGateway configuration"` } @@ -185,9 +185,8 @@ func ValidateConfig(cfg Config) (*Config, error) { gatewayPort := cfg.PrometheusGateway.Port if gatewayHost == "" { - return nil, fmt.Errorf( - "gateway hostname may not be empty", - ) + return nil, fmt.Errorf("gateway hostname may not be " + + "empty") } if gatewayPort == 0 { diff --git a/itest/loadtest/load_test.go b/itest/loadtest/load_test.go index edc63b7a3..59229d3e2 100644 --- a/itest/loadtest/load_test.go +++ b/itest/loadtest/load_test.go @@ -82,7 +82,8 @@ func TestPerformance(t *testing.T) { t.Fatalf("test case %v failed", tc.name) } - // Calculate the test duration and push metrics if the test case succeeded. + // Calculate the test duration and push metrics if the test case + // succeeded. if cfg.PrometheusGateway.Enabled { duration := time.Since(startTime).Seconds() @@ -93,19 +94,22 @@ func TestPerformance(t *testing.T) { // Update the metric with the test duration. testDuration.WithLabelValues(label).Set(duration) - t.Logf("Pushing testDuration %v with label %v to gateway", duration, label) + t.Logf("Pushing testDuration %v with label %v to "+ + "gateway", duration, label) // Create a new pusher to push the metrics. - pusher := push.New(cfg.PrometheusGateway.PushURL, "load_test"). - Collector(testDuration) + pusher := push.New( + cfg.PrometheusGateway.PushURL, "load_test", + ).Collector(testDuration) // Push the metrics to Prometheus PushGateway. if err := pusher.Add(); err != nil { - t.Logf("Could not push metrics to Prometheus PushGateway: %v", - err) + t.Logf("Could not push metrics to Prometheus "+ + "PushGateway: %v", err) } else { - t.Logf("Metrics pushed for test case '%s': duration = %v seconds", - tc.name, duration) + t.Logf("Metrics pushed for test case '%s': "+ + "duration = %v seconds", tc.name, + duration) } } }