MCPcopy
hub / github.com/prometheus/pushgateway / MockMetricStore

Struct MockMetricStore

handler/handler_test.go:44–49  ·  view source on GitHub ↗

MockMetricStore isn't doing any of the validation and sanitation a real metric store implementation has to do. Those are tested in the storage package. Here we only ensure that the right method calls are performed by the code in the handlers.

Source from the content-addressed store, hash-verified

42// package. Here we only ensure that the right method calls are performed
43// by the code in the handlers.
44type MockMetricStore struct {
45 lastWriteRequest storage.WriteRequest
46 metricGroups storage.GroupingKeyToMetricGroup
47 writeRequests []storage.WriteRequest
48 err error // If non-nil, will be sent to Done channel in request.
49}
50
51func (m *MockMetricStore) SubmitWriteRequest(req storage.WriteRequest) {
52 m.writeRequests = append(m.writeRequests, req)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected