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

Function MustNewConstHistogram

prometheus/histogram.go:1386–1398  ·  view source on GitHub ↗

MustNewConstHistogram is a version of NewConstHistogram that panics where NewConstHistogram would have returned an error.

(
	desc *Desc,
	count uint64,
	sum float64,
	buckets map[float64]uint64,
	labelValues ...string,
)

Source from the content-addressed store, hash-verified

1384// MustNewConstHistogram is a version of NewConstHistogram that panics where
1385// NewConstHistogram would have returned an error.
1386func MustNewConstHistogram(
1387 desc *Desc,
1388 count uint64,
1389 sum float64,
1390 buckets map[float64]uint64,
1391 labelValues ...string,
1392) Metric {
1393 m, err := NewConstHistogram(desc, count, sum, buckets, labelValues...)
1394 if err != nil {
1395 panic(err)
1396 }
1397 return m
1398}
1399
1400// NewConstHistogramWithCreatedTimestamp does the same thing as NewConstHistogram but sets the created timestamp.
1401func NewConstHistogramWithCreatedTimestamp(

Callers 3

ExampleNewConstHistogramFunction · 0.92
TestWithExemplarsMetricFunction · 0.85

Calls 1

NewConstHistogramFunction · 0.85

Tested by 3

ExampleNewConstHistogramFunction · 0.74
TestWithExemplarsMetricFunction · 0.68