MCPcopy
hub / github.com/prometheus/client_golang / NewGaugeFunc

Method NewGaugeFunc

prometheus/promauto/auto.go:316–322  ·  view source on GitHub ↗

NewGaugeFunc works like the function of the same name in the prometheus package but it automatically registers the GaugeFunc with the Factory's Registerer.

(opts prometheus.GaugeOpts, function func() float64)

Source from the content-addressed store, hash-verified

314// package but it automatically registers the GaugeFunc with the Factory's
315// Registerer.
316func (f Factory) NewGaugeFunc(opts prometheus.GaugeOpts, function func() float64) prometheus.GaugeFunc {
317 g := prometheus.NewGaugeFunc(opts, function)
318 if f.r != nil {
319 f.r.MustRegister(g)
320 }
321 return g
322}
323
324// NewSummary works like the function of the same name in the prometheus package
325// but it automatically registers the Summary with the Factory's Registerer.

Callers 2

NewGaugeFuncFunction · 0.80
runMainFunction · 0.80

Calls 2

NewGaugeFuncFunction · 0.92
MustRegisterMethod · 0.65

Tested by

no test coverage detected