diff --git a/go.mod b/go.mod index 9d3d959d6..629910196 100644 --- a/go.mod +++ b/go.mod @@ -8,7 +8,7 @@ require ( // Do not use the original github.com/valyala/fasthttp because of issues // like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b github.com/VictoriaMetrics/fasthttp v1.0.1 - github.com/VictoriaMetrics/metrics v1.11.3 + github.com/VictoriaMetrics/metrics v1.12.0 github.com/VictoriaMetrics/metricsql v0.2.7 github.com/aws/aws-sdk-go v1.33.5 github.com/cespare/xxhash/v2 v2.1.1 @@ -17,7 +17,7 @@ require ( github.com/valyala/fastjson v1.5.3 github.com/valyala/fastrand v1.0.0 github.com/valyala/gozstd v1.7.0 - github.com/valyala/histogram v1.0.1 + github.com/valyala/histogram v1.1.2 github.com/valyala/quicktemplate v1.5.1 golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d golang.org/x/sys v0.0.0-20200625212154-ddb9806d33ae diff --git a/go.sum b/go.sum index 404cfd206..d1a641c7e 100644 --- a/go.sum +++ b/go.sum @@ -51,8 +51,8 @@ github.com/VictoriaMetrics/fasthttp v1.0.1 h1:I7YdbswTIW63WxoFoUOSNxeOEGB46rdKUL github.com/VictoriaMetrics/fasthttp v1.0.1/go.mod h1:BqgsieH90PR7x97c89j+eqZDloKkDhAEQTwhLw6jw/4= github.com/VictoriaMetrics/metrics v1.11.2 h1:t/ceLP6SvagUqypCKU7cI7+tQn54+TIV/tGoxihHvx8= github.com/VictoriaMetrics/metrics v1.11.2/go.mod h1:LU2j9qq7xqZYXz8tF3/RQnB2z2MbZms5TDiIg9/NHiQ= -github.com/VictoriaMetrics/metrics v1.11.3 h1:eSfXc0CrquKa1VTNUvhP+dhNjLUZHQGTFfp19mYCQWE= -github.com/VictoriaMetrics/metrics v1.11.3/go.mod h1:LU2j9qq7xqZYXz8tF3/RQnB2z2MbZms5TDiIg9/NHiQ= +github.com/VictoriaMetrics/metrics v1.12.0 h1:BudxtRYSA6j8H9mzjhXNEIsCPIEUPCb76QwFEptQzvQ= +github.com/VictoriaMetrics/metrics v1.12.0/go.mod h1:Z1tSfPfngDn12bTfZSCqArT3OPY3u88J12hSoOhuiRE= github.com/VictoriaMetrics/metricsql v0.2.7 h1:4FXyJJjXTbAPVAakEEwaFSD0YOEPKEjdZKNQrWN76Ts= github.com/VictoriaMetrics/metricsql v0.2.7/go.mod h1:UIjd9S0W1UnTWlJdM0wLS+2pfuPqjwqKoK8yTos+WyE= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= @@ -173,6 +173,8 @@ github.com/valyala/gozstd v1.7.0 h1:Ljh5c9zboqLhwTI33al32R72iCZfn0mCbVGcFWbGwRQ= github.com/valyala/gozstd v1.7.0/go.mod h1:y5Ew47GLlP37EkTB+B4s7r6A5rdaeB7ftbl9zoYiIPQ= github.com/valyala/histogram v1.0.1 h1:FzA7n2Tz/wKRMejgu3PV1vw3htAklTjjuoI6z3d4KDg= github.com/valyala/histogram v1.0.1/go.mod h1:lQy0xA4wUz2+IUnf97SivorsJIp8FxsnRd6x25q7Mto= +github.com/valyala/histogram v1.1.2 h1:vOk5VrGjMBIoPR5k6wA8vBaC8toeJ8XO0yfRjFEc1h8= +github.com/valyala/histogram v1.1.2/go.mod h1:CZAr6gK9dbD7hYx2s8WSPh0p5x5wETjC+2b3PJVtEdg= github.com/valyala/quicktemplate v1.5.1 h1:JtrOtlRMP+pySF9dkPBfVfhZ3YHTitAJpMLNqT9ZjFk= github.com/valyala/quicktemplate v1.5.1/go.mod h1:v7yYWpBEiutDyNfVaph6oC/yKwejzVyTX/2cwwHxyok= github.com/valyala/tcplisten v0.0.0-20161114210144-ceec8f93295a/go.mod h1:v3UYOV9WzVtRmSR+PDvWpU/qWl4Wa5LApYYX4ZtKbio= diff --git a/vendor/github.com/VictoriaMetrics/metrics/gauge.go b/vendor/github.com/VictoriaMetrics/metrics/gauge.go index adc1f21b6..05bf1473f 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/gauge.go +++ b/vendor/github.com/VictoriaMetrics/metrics/gauge.go @@ -18,6 +18,8 @@ import ( // f must be safe for concurrent calls. // // The returned gauge is safe to use from concurrent goroutines. +// +// See also FloatCounter for working with floating-point values. func NewGauge(name string, f func() float64) *Gauge { return defaultSet.NewGauge(name, f) } @@ -58,6 +60,8 @@ func (g *Gauge) marshalTo(prefix string, w io.Writer) { // The returned gauge is safe to use from concurrent goroutines. // // Performance tip: prefer NewGauge instead of GetOrCreateGauge. +// +// See also FloatCounter for working with floating-point values. func GetOrCreateGauge(name string, f func() float64) *Gauge { return defaultSet.GetOrCreateGauge(name, f) } diff --git a/vendor/github.com/VictoriaMetrics/metrics/go.mod b/vendor/github.com/VictoriaMetrics/metrics/go.mod index 15e3dccdd..a66c19bd3 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/go.mod +++ b/vendor/github.com/VictoriaMetrics/metrics/go.mod @@ -1,5 +1,5 @@ module github.com/VictoriaMetrics/metrics -require github.com/valyala/histogram v1.0.1 +require github.com/valyala/histogram v1.1.2 go 1.12 diff --git a/vendor/github.com/VictoriaMetrics/metrics/go.sum b/vendor/github.com/VictoriaMetrics/metrics/go.sum index 9dd64f0a0..b1219448d 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/go.sum +++ b/vendor/github.com/VictoriaMetrics/metrics/go.sum @@ -1,4 +1,4 @@ github.com/valyala/fastrand v1.0.0 h1:LUKT9aKer2dVQNUi3waewTbKV+7H17kvWFNKs2ObdkI= github.com/valyala/fastrand v1.0.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= -github.com/valyala/histogram v1.0.1 h1:FzA7n2Tz/wKRMejgu3PV1vw3htAklTjjuoI6z3d4KDg= -github.com/valyala/histogram v1.0.1/go.mod h1:lQy0xA4wUz2+IUnf97SivorsJIp8FxsnRd6x25q7Mto= +github.com/valyala/histogram v1.1.2 h1:vOk5VrGjMBIoPR5k6wA8vBaC8toeJ8XO0yfRjFEc1h8= +github.com/valyala/histogram v1.1.2/go.mod h1:CZAr6gK9dbD7hYx2s8WSPh0p5x5wETjC+2b3PJVtEdg= diff --git a/vendor/github.com/valyala/histogram/go.mod b/vendor/github.com/valyala/histogram/go.mod index 9710bc72b..984efbe63 100644 --- a/vendor/github.com/valyala/histogram/go.mod +++ b/vendor/github.com/valyala/histogram/go.mod @@ -1,3 +1,5 @@ module github.com/valyala/histogram +go 1.12 + require github.com/valyala/fastrand v1.0.0 diff --git a/vendor/github.com/valyala/histogram/histogram.go b/vendor/github.com/valyala/histogram/histogram.go index 3dce6404f..e90dd7033 100644 --- a/vendor/github.com/valyala/histogram/histogram.go +++ b/vendor/github.com/valyala/histogram/histogram.go @@ -41,8 +41,14 @@ func (f *Fast) Reset() { f.max = infNeg f.min = infPos f.count = 0 - f.a = f.a[:0] - f.tmp = f.tmp[:0] + if len(f.a) > 0 { + f.a = f.a[:0] + f.tmp = f.tmp[:0] + } else { + // Free up memory occupied by unused histogram. + f.a = nil + f.tmp = nil + } } // Update updates the f with v. diff --git a/vendor/modules.txt b/vendor/modules.txt index b280a0bc1..f2b3fa7b1 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -14,7 +14,7 @@ github.com/VictoriaMetrics/fastcache github.com/VictoriaMetrics/fasthttp github.com/VictoriaMetrics/fasthttp/fasthttputil github.com/VictoriaMetrics/fasthttp/stackless -# github.com/VictoriaMetrics/metrics v1.11.3 +# github.com/VictoriaMetrics/metrics v1.12.0 github.com/VictoriaMetrics/metrics # github.com/VictoriaMetrics/metricsql v0.2.7 github.com/VictoriaMetrics/metricsql @@ -106,7 +106,7 @@ github.com/valyala/fastjson/fastfloat github.com/valyala/fastrand # github.com/valyala/gozstd v1.7.0 github.com/valyala/gozstd -# github.com/valyala/histogram v1.0.1 +# github.com/valyala/histogram v1.1.2 github.com/valyala/histogram # github.com/valyala/quicktemplate v1.5.1 github.com/valyala/quicktemplate