Merge branch 'master' into master
Some checks failed
dependabot-automerge / automerge (pull_request) Has been skipped
automerge / automerge (pull_request) Failing after 14s
autoapprove / autoapprove (pull_request) Failing after 30s
lint / lint (pull_request) Successful in 47s
test / test (pull_request) Successful in 13m17s
Some checks failed
dependabot-automerge / automerge (pull_request) Has been skipped
automerge / automerge (pull_request) Failing after 14s
autoapprove / autoapprove (pull_request) Failing after 30s
lint / lint (pull_request) Successful in 47s
test / test (pull_request) Successful in 13m17s
This commit is contained in:
commit
09528896b1
@ -49,10 +49,12 @@ type floatCounters struct {
|
|||||||
cs map[uint64]*prometheusFloatCounter
|
cs map[uint64]*prometheusFloatCounter
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
func newFloat64(v float64) *float64 {
|
func newFloat64(v float64) *float64 {
|
||||||
nv := v
|
nv := v
|
||||||
return &nv
|
return &nv
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
func newString(v string) *string {
|
func newString(v string) *string {
|
||||||
nv := v
|
nv := v
|
||||||
@ -268,16 +270,22 @@ func (m *prometheusMeter) SummaryExt(name string, window time.Duration, quantile
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (m *prometheusMeter) Init(opts ...options.Option) error {
|
func (m *prometheusMeter) Init(opts ...options.Option) error {
|
||||||
|
var err error
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&m.opts)
|
if err = o(&m.opts); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *prometheusMeter) Write(w io.Writer, opts ...options.Option) error {
|
func (m *prometheusMeter) Write(w io.Writer, opts ...options.Option) error {
|
||||||
|
var err error
|
||||||
options := m.opts
|
options := m.opts
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&options)
|
if err = o(&options); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.WriteProcessMetrics || options.WriteFDMetrics {
|
if options.WriteProcessMetrics || options.WriteFDMetrics {
|
||||||
@ -388,7 +396,7 @@ func (m *prometheusMeter) Write(w io.Writer, opts ...options.Option) error {
|
|||||||
func (m *prometheusMeter) Clone(opts ...options.Option) meter.Meter {
|
func (m *prometheusMeter) Clone(opts ...options.Option) meter.Meter {
|
||||||
options := m.opts
|
options := m.opts
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&options)
|
_ = o(&options)
|
||||||
}
|
}
|
||||||
|
|
||||||
return &prometheusMeter{
|
return &prometheusMeter{
|
||||||
@ -413,7 +421,7 @@ func (m *prometheusMeter) String() string {
|
|||||||
func (m *prometheusMeter) Set(opts ...options.Option) meter.Meter {
|
func (m *prometheusMeter) Set(opts ...options.Option) meter.Meter {
|
||||||
nm := &prometheusMeter{opts: m.opts}
|
nm := &prometheusMeter{opts: m.opts}
|
||||||
for _, o := range opts {
|
for _, o := range opts {
|
||||||
o(&nm.opts)
|
_ = o(&nm.opts)
|
||||||
}
|
}
|
||||||
nm.set = prometheus.NewRegistry()
|
nm.set = prometheus.NewRegistry()
|
||||||
return nm
|
return nm
|
||||||
|
Loading…
x
Reference in New Issue
Block a user