MCPcopy
hub / github.com/prometheus/prometheus / expectSamples

Method expectSamples

storage/remote/queue_manager_test.go:901–916  ·  view source on GitHub ↗

expectSamples injects samples that will be expected on waitForExpectedData.

(ss []record.RefSample, series []record.RefSeries)

Source from the content-addressed store, hash-verified

899
900// expectSamples injects samples that will be expected on waitForExpectedData.
901func (c *TestWriteClient) expectSamples(ss []record.RefSample, series []record.RefSeries) {
902 c.mtx.Lock()
903 defer c.mtx.Unlock()
904
905 c.expectedSamples = map[string][]writev2.Sample{}
906 c.receivedSamples = map[string][]writev2.Sample{}
907
908 for _, s := range ss {
909 tsID := getSeriesIDFromRef(series[s.Ref])
910 c.expectedSamples[tsID] = append(c.expectedSamples[tsID], writev2.Sample{
911 StartTimestamp: s.ST,
912 Timestamp: s.T,
913 Value: s.V,
914 })
915 }
916}
917
918func (c *TestWriteClient) expectExemplars(ss []record.RefExemplar, series []record.RefSeries) {
919 c.mtx.Lock()

Callers 7

TestSampleDeliveryFunction · 0.95
TestWALMetadataDeliveryFunction · 0.95
TestReshardFunction · 0.95
TestDropOldTimeSeriesFunction · 0.95
TestSampleDeliveryOrderFunction · 0.80

Calls 2

getSeriesIDFromRefFunction · 0.85
LockMethod · 0.80

Tested by

no test coverage detected