micro v4 options fix
Some checks failed
autoapprove / autoapprove (pull_request) Failing after 11s
automerge / automerge (pull_request) Failing after 7s
codeql / analyze (go) (pull_request) Failing after 3m30s
dependabot-automerge / automerge (pull_request) Has been skipped
prbuild / test (pull_request) Failing after 1m59s
prbuild / lint (pull_request) Successful in 24s

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
Василий Толстов 2023-08-16 15:32:09 +03:00
parent 78571b68ab
commit 3f589b20c4
3 changed files with 16 additions and 9 deletions

5
go.mod
View File

@ -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
)

9
go.sum
View File

@ -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=

View File

@ -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)