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

Method NewHistogram

prometheus/promauto/auto.go:348–354  ·  view source on GitHub ↗

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

(opts prometheus.HistogramOpts)

Source from the content-addressed store, hash-verified

346// package but it automatically registers the Histogram with the Factory's
347// Registerer.
348func (f Factory) NewHistogram(opts prometheus.HistogramOpts) prometheus.Histogram {
349 h := prometheus.NewHistogram(opts)
350 if f.r != nil {
351 f.r.MustRegister(h)
352 }
353 return h
354}
355
356// NewHistogramVec works like the function of the same name in the prometheus
357// package but it automatically registers the HistogramVec with the Factory's

Callers 2

NewHistogramFunction · 0.80
runMainFunction · 0.80

Calls 2

NewHistogramFunction · 0.92
MustRegisterMethod · 0.65

Tested by

no test coverage detected