From 3f589b20c441da47b265fb038fe8d89183639700 Mon Sep 17 00:00:00 2001 From: Vasiliy Tolstov Date: Wed, 16 Aug 2023 15:32:09 +0300 Subject: [PATCH] micro v4 options fix Signed-off-by: Vasiliy Tolstov --- go.mod | 5 +++-- go.sum | 9 +++++++-- victoriametrics.go | 11 ++++++----- 3 files changed, 16 insertions(+), 9 deletions(-) diff --git a/go.mod b/go.mod index fd76545..62ff1e9 100644 --- a/go.mod +++ b/go.mod @@ -3,11 +3,12 @@ module go.unistack.org/micro-meter-victoriametrics/v4 go 1.20 require ( - github.com/VictoriaMetrics/metrics v1.18.1 - go.unistack.org/micro/v4 v4.0.1 + github.com/VictoriaMetrics/metrics v1.24.0 + go.unistack.org/micro/v4 v4.0.7 ) require ( github.com/valyala/fastrand v1.1.0 // indirect github.com/valyala/histogram v1.2.0 // indirect + golang.org/x/sys v0.11.0 // indirect ) diff --git a/go.sum b/go.sum index cec4915..4e1a74d 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,13 @@ -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/metrics v1.23.1 h1:/j8DzeJBxSpL2qSIdqnRFLvQQhbJyJbbEi22yMm7oL0= +github.com/VictoriaMetrics/metrics v1.24.0 h1:ILavebReOjYctAGY5QU2F9X0MYvkcrG3aEn2RKa1Zkw= +github.com/VictoriaMetrics/metrics v1.24.0/go.mod h1:eFT25kvsTidQFHb6U0oa0rTrDRdz4xTYjpL8+UPohys= github.com/valyala/fastrand v1.1.0 h1:f+5HkLW4rsgzdNoleUOB69hyT9IlD2ZQh9GyDMfb5G8= github.com/valyala/fastrand v1.1.0/go.mod h1:HWqCzkrkg6QXT8V2EXWvXCoow7vLwOFN002oeRzjapQ= github.com/valyala/histogram v1.2.0 h1:wyYGAZZt3CpwUiIb9AU/Zbllg1llXyrtApRS815OLoQ= github.com/valyala/histogram v1.2.0/go.mod h1:Hb4kBwb4UxsaNbbbh+RRz8ZR6pdodR57tzWUS3BUzXY= go.unistack.org/micro/v4 v4.0.1 h1:xo1IxbVfgh8i0eY0VeYa3cbb13u5n/Mxnp3FOgWD4Jo= go.unistack.org/micro/v4 v4.0.1/go.mod h1:p/J5UcSJjfHsWGT31uKoghQ5rUQZzQJBAFy+Z4+ZVMs= +go.unistack.org/micro/v4 v4.0.7 h1:2lwtZlHcSwgkahhFbkI4x1lOS79lw8uLHtcEhlFF+AM= +go.unistack.org/micro/v4 v4.0.7/go.mod h1:bVEYTlPi0EsdgZZt311bIroDg9ict7ky3C87dSCCAGk= +golang.org/x/sys v0.11.0 h1:eG7RXZHdqOJ1i+0lgLgCpSXAp6M3LYlAo6osgSi0xOM= +golang.org/x/sys v0.11.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= diff --git a/victoriametrics.go b/victoriametrics.go index 933d52c..e862940 100644 --- a/victoriametrics.go +++ b/victoriametrics.go @@ -6,6 +6,7 @@ import ( "github.com/VictoriaMetrics/metrics" "go.unistack.org/micro/v4/meter" + "go.unistack.org/micro/v4/options" ) type victoriametricsMeter struct { @@ -13,7 +14,7 @@ type victoriametricsMeter struct { opts meter.Options } -func NewMeter(opts ...meter.Option) meter.Meter { +func NewMeter(opts ...options.Option) meter.Meter { return &victoriametricsMeter{set: metrics.NewSet(), opts: meter.NewOptions(opts...)} } @@ -21,7 +22,7 @@ func (r *victoriametricsMeter) Name() string { return r.opts.Name } -func (r *victoriametricsMeter) Clone(opts ...meter.Option) meter.Meter { +func (r *victoriametricsMeter) Clone(opts ...options.Option) meter.Meter { options := r.opts for _, o := range opts { o(&options) @@ -78,7 +79,7 @@ func (r *victoriametricsMeter) SummaryExt(name string, window time.Duration, qua return r.set.GetOrCreateSummaryExt(r.buildName(name, labels...), window, quantiles) } -func (r *victoriametricsMeter) Set(opts ...meter.Option) meter.Meter { +func (r *victoriametricsMeter) Set(opts ...options.Option) meter.Meter { m := &victoriametricsMeter{opts: r.opts} for _, o := range opts { o(&m.opts) @@ -87,7 +88,7 @@ func (r *victoriametricsMeter) Set(opts ...meter.Option) meter.Meter { return m } -func (r *victoriametricsMeter) Init(opts ...meter.Option) error { +func (r *victoriametricsMeter) Init(opts ...options.Option) error { for _, o := range opts { o(&r.opts) } @@ -95,7 +96,7 @@ func (r *victoriametricsMeter) Init(opts ...meter.Option) error { return nil } -func (r *victoriametricsMeter) Write(w io.Writer, opts ...meter.Option) error { +func (r *victoriametricsMeter) Write(w io.Writer, opts ...options.Option) error { options := r.opts for _, o := range opts { o(&options) -- 2.45.2