diff --git a/go.mod b/go.mod index 79dabb836..6dc50a1aa 100644 --- a/go.mod +++ b/go.mod @@ -10,7 +10,7 @@ require ( // like https://github.com/valyala/fasthttp/commit/996610f021ff45fdc98c2ce7884d5fa4e7f9199b github.com/VictoriaMetrics/fasthttp v1.1.0 github.com/VictoriaMetrics/metrics v1.18.1 - github.com/VictoriaMetrics/metricsql v0.44.0 + github.com/VictoriaMetrics/metricsql v0.44.1 github.com/aws/aws-sdk-go v1.44.43 github.com/cespare/xxhash/v2 v2.1.2 diff --git a/go.sum b/go.sum index 7076687a4..566cfbd28 100644 --- a/go.sum +++ b/go.sum @@ -108,8 +108,8 @@ github.com/VictoriaMetrics/fasthttp v1.1.0 h1:3crd4YWHsMwu60GUXRH6OstowiFvqrwS4a github.com/VictoriaMetrics/fasthttp v1.1.0/go.mod h1:/7DMcogqd+aaD3G3Hg5kFgoFwlR2uydjiWvoLp5ZTqQ= github.com/VictoriaMetrics/metrics v1.18.1 h1:OZ0+kTTto8oPfHnVAnTOoyl0XlRhRkoQrD2n2cOuRw0= github.com/VictoriaMetrics/metrics v1.18.1/go.mod h1:ArjwVz7WpgpegX/JpB0zpNF2h2232kErkEnzH1sxMmA= -github.com/VictoriaMetrics/metricsql v0.44.0 h1:zxBVeg9tbm6zl2ft2Ica87ItUWYey02hy3MN2ti1ljg= -github.com/VictoriaMetrics/metricsql v0.44.0/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0= +github.com/VictoriaMetrics/metricsql v0.44.1 h1:qGoRt0g84uMUscVjS7P3uDZKmjJubWKaIx9v0iHKgck= +github.com/VictoriaMetrics/metricsql v0.44.1/go.mod h1:6pP1ZeLVJHqJrHlF6Ij3gmpQIznSsgktEcZgsAWYel0= github.com/VividCortex/ewma v1.2.0 h1:f58SaIzcDXrSy3kWaHNvuJgJ3Nmz59Zji6XoJR/q1ow= github.com/VividCortex/ewma v1.2.0/go.mod h1:nz4BbCtbLyFDeC9SUHbtcT5644juEuWfUAUnGx7j5l4= github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= diff --git a/vendor/github.com/VictoriaMetrics/metricsql/regexp_cache.go b/vendor/github.com/VictoriaMetrics/metricsql/regexp_cache.go index d41e1fc08..e9d49bb16 100644 --- a/vendor/github.com/VictoriaMetrics/metricsql/regexp_cache.go +++ b/vendor/github.com/VictoriaMetrics/metricsql/regexp_cache.go @@ -60,13 +60,6 @@ type regexpCacheValue struct { err error } -func (rcv *regexpCacheValue) RegexpLen() int { - if r := rcv.r; r != nil { - return len(r.String()) - } - return len(rcv.err.Error()) -} - type regexpCache struct { // Move atomic counters to the top of struct for 8-byte alignment on 32-bit arch. // See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/212 @@ -131,10 +124,10 @@ func (rc *regexpCache) Put(regexp string, rcv *regexpCacheValue) { if rc.charsCurrent > rc.charsLimit { // Remove items accounting for 10% chars from the cache. overflow := int(float64(rc.charsLimit) * 0.1) - for k, v := range rc.m { + for k := range rc.m { delete(rc.m, k) - size := len(k) + v.RegexpLen() + size := len(k) overflow -= size rc.charsCurrent -= size @@ -144,6 +137,6 @@ func (rc *regexpCache) Put(regexp string, rcv *regexpCacheValue) { } } rc.m[regexp] = rcv - rc.charsCurrent += len(regexp) + rcv.RegexpLen() + rc.charsCurrent += len(regexp) rc.mu.Unlock() } diff --git a/vendor/modules.txt b/vendor/modules.txt index a8814f5c6..d42054ede 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -27,7 +27,7 @@ github.com/VictoriaMetrics/fasthttp/stackless # github.com/VictoriaMetrics/metrics v1.18.1 ## explicit; go 1.12 github.com/VictoriaMetrics/metrics -# github.com/VictoriaMetrics/metricsql v0.44.0 +# github.com/VictoriaMetrics/metricsql v0.44.1 ## explicit; go 1.13 github.com/VictoriaMetrics/metricsql github.com/VictoriaMetrics/metricsql/binaryop