From 7354f1033638dc2ddfbf3aa4315a49476ca5f2ba Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 28 Jun 2019 14:16:29 +0300 Subject: [PATCH] vendor: update github.com/VictoriaMetrics/metrics to v1.6.2 This fixes Summary printing for *_count and *_sum values with metric names containing labels. --- go.mod | 2 +- go.sum | 4 ++-- vendor/github.com/VictoriaMetrics/metrics/go.mod | 2 ++ .../github.com/VictoriaMetrics/metrics/summary.go | 14 ++++++++++++-- vendor/modules.txt | 2 +- 5 files changed, 18 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 3e98ee11a..7c87efac4 100644 --- a/go.mod +++ b/go.mod @@ -2,7 +2,7 @@ module github.com/VictoriaMetrics/VictoriaMetrics require ( github.com/VictoriaMetrics/fastcache v1.5.1 - github.com/VictoriaMetrics/metrics v1.6.1 + github.com/VictoriaMetrics/metrics v1.6.2 github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 github.com/golang/snappy v0.0.1 github.com/spaolacci/murmur3 v1.1.0 // indirect diff --git a/go.sum b/go.sum index 923c274bc..a699aa0bb 100644 --- a/go.sum +++ b/go.sum @@ -3,8 +3,8 @@ github.com/OneOfOne/xxhash v1.2.5 h1:zl/OfRA6nftbBK9qTohYBJ5xvw6C/oNKizR7cZGl3cI github.com/OneOfOne/xxhash v1.2.5/go.mod h1:eZbhyaAYD41SGSSsnmcpxVoRiQ/MPUTjUdIIOT9Um7Q= github.com/VictoriaMetrics/fastcache v1.5.1 h1:qHgHjyoNFV7jgucU8QZUuU4gcdhfs8QW1kw68OD2Lag= github.com/VictoriaMetrics/fastcache v1.5.1/go.mod h1:+jv9Ckb+za/P1ZRg/sulP5Ni1v49daAVERr0H3CuscE= -github.com/VictoriaMetrics/metrics v1.6.1 h1:jHLmdFDuoXJC41FVvYVLoMzRieu7MOxFjYZdPHBN0EQ= -github.com/VictoriaMetrics/metrics v1.6.1/go.mod h1:QZAL5yLaXvhSPeib0ahluGo9VK0HXDZHovKaKlpuWvs= +github.com/VictoriaMetrics/metrics v1.6.2 h1:VMe8c8ZBPgNVZkPoT06LsoU2nb+8e7iPaOWbVRNhxjo= +github.com/VictoriaMetrics/metrics v1.6.2/go.mod h1:LU2j9qq7xqZYXz8tF3/RQnB2z2MbZms5TDiIg9/NHiQ= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156 h1:eMwmnE/GDgah4HI848JfFxHt+iPb26b4zyfspmqY0/8= github.com/allegro/bigcache v1.2.1-0.20190218064605-e24eb225f156/go.mod h1:Cb/ax3seSYIx7SuZdm2G2xzfwmv3TPSk2ucNfQESPXM= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= diff --git a/vendor/github.com/VictoriaMetrics/metrics/go.mod b/vendor/github.com/VictoriaMetrics/metrics/go.mod index 7a4629bb2..15e3dccdd 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/go.mod +++ b/vendor/github.com/VictoriaMetrics/metrics/go.mod @@ -1,3 +1,5 @@ module github.com/VictoriaMetrics/metrics require github.com/valyala/histogram v1.0.1 + +go 1.12 diff --git a/vendor/github.com/VictoriaMetrics/metrics/summary.go b/vendor/github.com/VictoriaMetrics/metrics/summary.go index 3bb002dc7..def1f4e7b 100644 --- a/vendor/github.com/VictoriaMetrics/metrics/summary.go +++ b/vendor/github.com/VictoriaMetrics/metrics/summary.go @@ -4,6 +4,7 @@ import ( "fmt" "io" "math" + "strings" "sync" "time" @@ -107,11 +108,20 @@ func (sm *Summary) marshalTo(prefix string, w io.Writer) { sm.mu.Unlock() if count > 0 { - fmt.Fprintf(w, "%s_sum %g\n", prefix, sum) - fmt.Fprintf(w, "%s_count %d\n", prefix, count) + name, filters := splitMetricName(prefix) + fmt.Fprintf(w, "%s_sum%s %g\n", name, filters, sum) + fmt.Fprintf(w, "%s_count%s %d\n", name, filters, count) } } +func splitMetricName(name string) (string, string) { + n := strings.IndexByte(name, '{') + if n < 0 { + return name, "" + } + return name[:n], name[n:] +} + func (sm *Summary) updateQuantiles() { sm.mu.Lock() sm.quantileValues = sm.curr.Quantiles(sm.quantileValues[:0], sm.quantiles) diff --git a/vendor/modules.txt b/vendor/modules.txt index e2fb8b7c2..7fe78a42f 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1,6 +1,6 @@ # github.com/VictoriaMetrics/fastcache v1.5.1 github.com/VictoriaMetrics/fastcache -# github.com/VictoriaMetrics/metrics v1.6.1 +# github.com/VictoriaMetrics/metrics v1.6.2 github.com/VictoriaMetrics/metrics # github.com/cespare/xxhash/v2 v2.0.1-0.20190104013014-3767db7a7e18 github.com/cespare/xxhash/v2