MCPcopy
hub / github.com/prometheus/prometheus / NewTestWriteClient

Function NewTestWriteClient

storage/remote/queue_manager_test.go:882–892  ·  view source on GitHub ↗

NewTestWriteClient creates a new testing write client.

(protoMsg remoteapi.WriteMessageType)

Source from the content-addressed store, hash-verified

880
881// NewTestWriteClient creates a new testing write client.
882func NewTestWriteClient(protoMsg remoteapi.WriteMessageType) *TestWriteClient {
883 return &TestWriteClient{
884 receivedSamples: map[string][]writev2.Sample{},
885 expectedSamples: map[string][]writev2.Sample{},
886 receivedMetadata: map[string][]prompb.MetricMetadata{},
887 expectedMetadata: map[string][]prompb.MetricMetadata{},
888 protoMsg: protoMsg,
889 storeWait: 0,
890 returnError: nil,
891 }
892}
893
894func (c *TestWriteClient) injectErrors(injectedErrs []error) {
895 c.injectedErrs = injectedErrs

Callers 11

TestSampleDeliveryFunction · 0.85
TestWALMetadataDeliveryFunction · 0.85
TestReshardFunction · 0.85
TestReshardRaceWithStopFunction · 0.85
BenchmarkStoreSeriesFunction · 0.85
TestDropOldTimeSeriesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…