toMetricsSet converts a slice of metric names to a set for O(1) lookup.
(metrics []string)
| 175 | |
| 176 | // toMetricsSet converts a slice of metric names to a set for O(1) lookup. |
| 177 | func toMetricsSet(metrics []string) map[string]bool { |
| 178 | set := make(map[string]bool, len(metrics)) |
| 179 | for _, m := range metrics { |
| 180 | set[m] = true |
| 181 | } |
| 182 | return set |
| 183 | } |
| 184 | |
| 185 | // cleanupExpired removes expired entries from the cache. |
| 186 | func (c *MetricsCache) cleanupExpired() { |
no outgoing calls
no test coverage detected