MCPcopy
hub / github.com/prometheus/prometheus / TestWriteClient

Struct TestWriteClient

storage/remote/queue_manager_test.go:858–879  ·  view source on GitHub ↗

TestWriteClient represents write client which does not call remote storage, but instead re-implements fake WriteHandler for test purposes.

Source from the content-addressed store, hash-verified

856// TestWriteClient represents write client which does not call remote storage,
857// but instead re-implements fake WriteHandler for test purposes.
858type TestWriteClient struct {
859 receivedSamples map[string][]writev2.Sample
860 expectedSamples map[string][]writev2.Sample
861 receivedExemplars map[string][]prompb.Exemplar
862 expectedExemplars map[string][]prompb.Exemplar
863 receivedHistograms map[string][]prompb.Histogram
864 receivedFloatHistograms map[string][]prompb.Histogram
865 expectedHistograms map[string][]prompb.Histogram
866 expectedFloatHistograms map[string][]prompb.Histogram
867 receivedMetadata map[string][]prompb.MetricMetadata
868 expectedMetadata map[string][]prompb.MetricMetadata
869 writesReceived int
870 mtx sync.Mutex
871 protoMsg remoteapi.WriteMessageType
872 injectedErrs []error
873 currErr int
874 retry bool
875
876 storeWait time.Duration
877 // TODO(npazosmendez): maybe replaceable with injectedErrs?
878 returnError error
879}
880
881// NewTestWriteClient creates a new testing write client.
882func NewTestWriteClient(protoMsg remoteapi.WriteMessageType) *TestWriteClient {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected