MCPcopy
hub / github.com/grafana/grafana / toMetricsSet

Function toMetricsSet

apps/dashvalidator/pkg/cache/cache.go:177–183  ·  view source on GitHub ↗

toMetricsSet converts a slice of metric names to a set for O(1) lookup.

(metrics []string)

Source from the content-addressed store, hash-verified

175
176// toMetricsSet converts a slice of metric names to a set for O(1) lookup.
177func 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.
186func (c *MetricsCache) cleanupExpired() {

Callers 2

GetMetricsMethod · 0.85
GetMetricsSetMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected