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

Function makeNativeExemplars

prometheus/histogram.go:1696–1714  ·  view source on GitHub ↗
(ttl time.Duration, maxCount int)

Source from the content-addressed store, hash-verified

1694}
1695
1696func makeNativeExemplars(ttl time.Duration, maxCount int) nativeExemplars {
1697 if ttl == 0 {
1698 ttl = 5 * time.Minute
1699 }
1700
1701 if maxCount == 0 {
1702 maxCount = 10
1703 }
1704
1705 if maxCount < 0 {
1706 maxCount = 0
1707 ttl = -1
1708 }
1709
1710 return nativeExemplars{
1711 ttl: ttl,
1712 exemplars: make([]*dto.Exemplar, 0, maxCount),
1713 }
1714}
1715
1716func (n *nativeExemplars) addExemplar(e *dto.Exemplar) {
1717 if !n.isEnabled() {

Callers 1

newHistogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected