diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml new file mode 100644 index 00000000000..c14b91aa4f1 --- /dev/null +++ b/.github/workflows/benchmark.yml @@ -0,0 +1,32 @@ +name: Benchmark +on: + push: + branches: + - main +env: + DEFAULT_GO_VERSION: 1.16 +jobs: + benchmark: + name: Benchmarks + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2.4.0 + - uses: actions/setup-go@v2.2.0 + with: + go-version: ${{ env.DEFAULT_GO_VERSION }} + - name: Run benchmarks + run: make test-bench | tee output.txt + - name: Download previous benchmark data + uses: actions/cache@v2.1.7 + with: + path: ./benchmarks + key: ${{ runner.os }}-benchmark + - name: Store benchmarks result + uses: benchmark-action/github-action-benchmark@v1.13.0 + with: + name: Benchmarks + tool: 'go' + output-file-path: output.txt + external-data-json-path: ./benchmarks/data.json + auto-push: false + fail-on-alert: true diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go b/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go index bc979541c90..dc7eeda51d9 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/client_test.go @@ -93,7 +93,7 @@ func newGRPCExporter(t *testing.T, ctx context.Context, endpoint string, additio } func newExporterEndToEndTest(t *testing.T, additionalOpts []otlpmetricgrpc.Option) { - mc := runMockCollectorAtEndpoint(t, "localhost:56561") + mc := runMockCollector(t) defer func() { _ = mc.stop() @@ -115,7 +115,7 @@ func newExporterEndToEndTest(t *testing.T, additionalOpts []otlpmetricgrpc.Optio } func TestExporterShutdown(t *testing.T) { - mc := runMockCollectorAtEndpoint(t, "localhost:56561") + mc := runMockCollector(t) defer func() { _ = mc.Stop() }() @@ -296,7 +296,7 @@ func TestStartErrorInvalidAddress(t *testing.T) { } func TestEmptyData(t *testing.T) { - mc := runMockCollectorAtEndpoint(t, "localhost:56561") + mc := runMockCollector(t) defer func() { _ = mc.stop() @@ -314,7 +314,7 @@ func TestEmptyData(t *testing.T) { } func TestFailedMetricTransform(t *testing.T) { - mc := runMockCollectorAtEndpoint(t, "localhost:56561") + mc := runMockCollector(t) defer func() { _ = mc.stop() diff --git a/exporters/otlp/otlptrace/otlptracegrpc/client_test.go b/exporters/otlp/otlptrace/otlptracegrpc/client_test.go index 9a02ca227b6..191ff23afd4 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/client_test.go +++ b/exporters/otlp/otlptrace/otlptracegrpc/client_test.go @@ -374,7 +374,7 @@ func TestStartErrorInvalidAddress(t *testing.T) { } func TestEmptyData(t *testing.T) { - mc := runMockCollectorAtEndpoint(t, "localhost:56561") + mc := runMockCollector(t) t.Cleanup(func() { require.NoError(t, mc.stop()) }) <-time.After(5 * time.Millisecond) diff --git a/internal/tools/go.mod b/internal/tools/go.mod index 5ca64048db6..583d72b1a50 100644 --- a/internal/tools/go.mod +++ b/internal/tools/go.mod @@ -5,7 +5,7 @@ go 1.16 require ( github.com/client9/misspell v0.3.4 github.com/gogo/protobuf v1.3.2 - github.com/golangci/golangci-lint v1.44.1 + github.com/golangci/golangci-lint v1.44.2 github.com/itchyny/gojq v0.12.6 github.com/jcchavezs/porto v0.4.0 github.com/wadey/gocovmerge v0.0.0-20160331181800-b5bfa59ec0ad diff --git a/internal/tools/go.sum b/internal/tools/go.sum index 8a5ca47194e..1604fe5e896 100644 --- a/internal/tools/go.sum +++ b/internal/tools/go.sum @@ -172,8 +172,8 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/cpuguy83/go-md2man/v2 v2.0.1/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7DoTY= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= -github.com/daixiang0/gci v0.3.0 h1:6x2xp99la0TfGmdDJ6T2VrLtCoZwYUVp4/5zT8J7+Go= -github.com/daixiang0/gci v0.3.0/go.mod h1:jaASoJmv/ykO9dAAPy31iJnreV19248qKDdVWf3QgC4= +github.com/daixiang0/gci v0.3.1-0.20220208004058-76d765e3ab48 h1:9rJGqaC5do9zkvKrtRdx0HJoxj7Jd6vDa0O2eBU0AbU= +github.com/daixiang0/gci v0.3.1-0.20220208004058-76d765e3ab48/go.mod h1:jaASoJmv/ykO9dAAPy31iJnreV19248qKDdVWf3QgC4= github.com/davecgh/go-spew v0.0.0-20161028175848-04cdfd42973b/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= @@ -318,8 +318,8 @@ github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613 h1:9kfjN3AdxcbsZB github.com/golangci/go-misc v0.0.0-20180628070357-927a3d87b613/go.mod h1:SyvUF2NxV+sN8upjjeVYr5W7tyxaT1JVtvhKhOn2ii8= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a h1:iR3fYXUjHCR97qWS8ch1y9zPNsgXThGwjKPrYfqMPks= github.com/golangci/gofmt v0.0.0-20190930125516-244bba706f1a/go.mod h1:9qCChq59u/eW8im404Q2WWTrnBUQKjpNYKMbU4M7EFU= -github.com/golangci/golangci-lint v1.44.1 h1:/jcmjp9715WazPIu4oZz8KaV9xSq5HTuedjpWm/RVvc= -github.com/golangci/golangci-lint v1.44.1/go.mod h1:s0UbBHNNBlEPt8OcPsJV7IPONwQ+WEVywSk+FPpLV18= +github.com/golangci/golangci-lint v1.44.2 h1:MzvkDt1j1OHkv42/feNJVNNXRFACPp7aAWBWDo5aYQw= +github.com/golangci/golangci-lint v1.44.2/go.mod h1:KjBgkLvsTWDkhfu12iCrv0gwL1kON5KNhbyjQ6qN7Jo= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0 h1:MfyDlzVjl1hoaPzPD4Gpb/QgoRfSBR0jdhwGyAWwMSA= github.com/golangci/lint-1 v0.0.0-20191013205115-297bf364a8e0/go.mod h1:66R6K6P6VWk9I95jvqGxkqJxVWGFy9XlDwLwVz1RCFg= github.com/golangci/maligned v0.0.0-20180506175553-b1d89398deca h1:kNY3/svz5T29MYHubXix4aDDuE3RWHkPvopM/EDv/MA= @@ -842,8 +842,8 @@ github.com/tv42/httpunix v0.0.0-20150427012821-b75d8614f926/go.mod h1:9ESjWnEqri github.com/ugorji/go/codec v0.0.0-20181204163529-d75b2dcb6bc8/go.mod h1:VFNgLljTbGfSG7qAOspJ7OScBnGdDN/yBr0sguwnwf0= github.com/ultraware/funlen v0.0.3 h1:5ylVWm8wsNwH5aWo9438pwvsK0QiqVuUrt9bn7S/iLA= github.com/ultraware/funlen v0.0.3/go.mod h1:Dp4UiAus7Wdb9KUZsYWZEWiRzGuM2kXM1lPbfaF6xhA= -github.com/ultraware/whitespace v0.0.4 h1:If7Va4cM03mpgrNH9k49/VOicWpGoG70XPBFFODYDsg= -github.com/ultraware/whitespace v0.0.4/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= +github.com/ultraware/whitespace v0.0.5 h1:hh+/cpIcopyMYbZNVov9iSxvJU3OYQg78Sfaqzi/CzI= +github.com/ultraware/whitespace v0.0.5/go.mod h1:aVMh/gQve5Maj9hQ/hg+F75lr/X5A89uZnzAmWSineA= github.com/urfave/cli v1.20.0/go.mod h1:70zkFmudgCuE/ngEzBv17Jvp/497gISqfk5gWijbERA= github.com/urfave/cli v1.22.1/go.mod h1:Gos4lmkARVdJ6EkW0WaNv/tZAAMe9V7XWyB60NtXRu0= github.com/uudashr/gocognit v1.0.5 h1:rrSex7oHr3/pPLQ0xoWq108XMU8s678FJcQ+aSfOHa4=