MCPcopy Create free account
hub / github.com/zalando/skipper / waitForMeasure

Function waitForMeasure

routing/datasource_test.go:809–830  ·  view source on GitHub ↗
(t *testing.T, m *metricstest.MockMetrics, key string)

Source from the content-addressed store, hash-verified

807}
808
809func waitForMeasure(t *testing.T, m *metricstest.MockMetrics, key string) {
810 t.Helper()
811 timeout := time.After(time.Second)
812 ticker := time.NewTicker(time.Millisecond)
813 defer ticker.Stop()
814
815 for {
816 found := false
817 m.WithMeasures(func(measures map[string][]time.Duration) {
818 _, found = measures[key]
819 })
820 if found {
821 return
822 }
823
824 select {
825 case <-timeout:
826 t.Fatalf("timed out waiting for measure %q", key)
827 case <-ticker.C:
828 }
829 }
830}

Callers 1

Calls 2

WithMeasuresMethod · 0.80
StopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…