diff --git a/go.mod b/go.mod index 2857590e3857f..37d4fc9437836 100644 --- a/go.mod +++ b/go.mod @@ -120,7 +120,7 @@ require ( github.com/coder/quartz v0.1.0 github.com/d4l3k/messagediff v1.2.1 github.com/dolthub/swiss v0.2.1 - github.com/efficientgo/core v1.0.0-rc.2 + github.com/efficientgo/core v1.0.0-rc.3 github.com/fsnotify/fsnotify v1.7.0 github.com/gogo/googleapis v1.4.1 github.com/grafana/jsonparser v0.0.0-20240425183733-ea80629e1a32 diff --git a/go.sum b/go.sum index b889a88da3a17..bbf985b21ce1e 100644 --- a/go.sum +++ b/go.sum @@ -585,8 +585,8 @@ github.com/eclipse/paho.mqtt.golang v1.2.0/go.mod h1:H9keYFcgq3Qr5OUJm/JZI/i6U7j github.com/edsrzf/mmap-go v1.0.0/go.mod h1:YO35OhQPt3KJa3ryjFM5Bs14WD66h8eGKpfaBNrHW5M= github.com/edsrzf/mmap-go v1.1.0 h1:6EUwBLQ/Mcr1EYLE4Tn1VdW1A4ckqCQWZBw8Hr0kjpQ= github.com/edsrzf/mmap-go v1.1.0/go.mod h1:19H/e8pUPLicwkyNgOykDXkJ9F0MHE+Z52B8EIth78Q= -github.com/efficientgo/core v1.0.0-rc.2 h1:7j62qHLnrZqO3V3UA0AqOGd5d5aXV3AX6m/NZBHp78I= -github.com/efficientgo/core v1.0.0-rc.2/go.mod h1:FfGdkzWarkuzOlY04VY+bGfb1lWrjaL6x/GLcQ4vJps= +github.com/efficientgo/core v1.0.0-rc.3 h1:X6CdgycYWDcbYiJr1H1+lQGzx13o7bq3EUkbB9DsSPc= +github.com/efficientgo/core v1.0.0-rc.3/go.mod h1:FfGdkzWarkuzOlY04VY+bGfb1lWrjaL6x/GLcQ4vJps= github.com/efficientgo/e2e v0.13.1-0.20220922081603-45de9fc588a8 h1:UFLc39BcUXahSNCLUrKjNGZABMUZaS4M74EZvTRnq3k= github.com/efficientgo/e2e v0.13.1-0.20220922081603-45de9fc588a8/go.mod h1:Hi+sz0REtlhVZ8zcdeTC3j6LUEEpJpPtNjOaOKuNcgI= github.com/elazarl/goproxy v0.0.0-20170405201442-c4fc26588b6e/go.mod h1:/Zj4wYkgs4iZTTu3o/KG3Itv/qCCa8VVMlb3i9OVuzc= diff --git a/vendor/github.com/efficientgo/core/testutil/testorbench.go b/vendor/github.com/efficientgo/core/testutil/testorbench.go index c36b8877a1263..69f3fe60f8c05 100644 --- a/vendor/github.com/efficientgo/core/testutil/testorbench.go +++ b/vendor/github.com/efficientgo/core/testutil/testorbench.go @@ -30,7 +30,13 @@ type TB interface { SetBytes(n int64) N() int + ResetTimer() + StartTimer() + StopTimer() + + ReportAllocs() + ReportMetric(n float64, unit string) } // tb implements TB as well as testing.TB interfaces. @@ -78,8 +84,36 @@ func (t *tb) ResetTimer() { } } +// StartTimer starts a timer, if it's a benchmark, noop otherwise. +func (t *tb) StartTimer() { + if b, ok := t.TB.(*testing.B); ok { + b.StartTimer() + } +} + +// StopTimer stops a timer, if it's a benchmark, noop otherwise. +func (t *tb) StopTimer() { + if b, ok := t.TB.(*testing.B); ok { + b.StopTimer() + } +} + // IsBenchmark returns true if it's a benchmark. func (t *tb) IsBenchmark() bool { _, ok := t.TB.(*testing.B) return ok } + +// ReportAllocs reports allocs if it's a benchmark, noop otherwise. +func (t *tb) ReportAllocs() { + if b, ok := t.TB.(*testing.B); ok { + b.ReportAllocs() + } +} + +// ReportMetric reports metrics if it's a benchmark, noop otherwise. +func (t *tb) ReportMetric(n float64, unit string) { + if b, ok := t.TB.(*testing.B); ok { + b.ReportMetric(n, unit) + } +} diff --git a/vendor/modules.txt b/vendor/modules.txt index a6444780a683d..1e8afbaa9e66e 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -669,7 +669,7 @@ github.com/eapache/queue # github.com/edsrzf/mmap-go v1.1.0 ## explicit; go 1.17 github.com/edsrzf/mmap-go -# github.com/efficientgo/core v1.0.0-rc.2 +# github.com/efficientgo/core v1.0.0-rc.3 ## explicit; go 1.17 github.com/efficientgo/core/errcapture github.com/efficientgo/core/errors