TestWriteClient represents write client which does not call remote storage, but instead re-implements fake WriteHandler for test purposes.
| 856 | // TestWriteClient represents write client which does not call remote storage, |
| 857 | // but instead re-implements fake WriteHandler for test purposes. |
| 858 | type 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. |
| 882 | func NewTestWriteClient(protoMsg remoteapi.WriteMessageType) *TestWriteClient { |
nothing calls this directly
no outgoing calls
no test coverage detected