Function
makeNativeExemplars
(ttl time.Duration, maxCount int)
Source from the content-addressed store, hash-verified
| 1694 | } |
| 1695 | |
| 1696 | func 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 | |
| 1716 | func (n *nativeExemplars) addExemplar(e *dto.Exemplar) { |
| 1717 | if !n.isEnabled() { |
Tested by
no test coverage detected