MCPcopy Create free account
hub / github.com/deepflowio/deepflow / resetLayoutState

Function resetLayoutState

server/controller/prometheus/cache/cache_test.go:242–251  ·  view source on GitHub ↗
(mll *metricAndAPPLabelLayout, n int)

Source from the content-addressed store, hash-verified

240}
241
242func resetLayoutState(mll *metricAndAPPLabelLayout, n int) {
243 newActive := make(map[LayoutKey]uint8, n)
244 for i := 0; i < n; i++ {
245 newActive[NewLayoutKey(fmt.Sprintf("metric_%d", i/10), fmt.Sprintf("app_label_%d", i%10))] = uint8(i%10 + 1)
246 }
247 mll.mu.Lock()
248 mll.pending = make(map[LayoutKey]uint8)
249 mll.mu.Unlock()
250 mll.replaceActive(newActive)
251}
252
253func refreshLabelCurrent(l *label, batch []*controller.PrometheusLabel) {
254 l.Add(batch)

Callers 1

Calls 4

NewLayoutKeyFunction · 0.85
LockMethod · 0.45
UnlockMethod · 0.45
replaceActiveMethod · 0.45

Tested by

no test coverage detected