MCPcopy Create free account
hub / github.com/cortexproject/cortex / pushSingleSampleWithMetadata

Function pushSingleSampleWithMetadata

pkg/ingester/ingester_test.go:5736–5742  ·  view source on GitHub ↗
(t *testing.T, i *Ingester)

Source from the content-addressed store, hash-verified

5734}
5735
5736func pushSingleSampleWithMetadata(t *testing.T, i *Ingester) {
5737 ctx := user.InjectOrgID(context.Background(), userID)
5738 req, _ := mockWriteRequest(t, labels.FromStrings("__name__", "test"), 0, util.TimeToMillis(time.Now()))
5739 req.Metadata = append(req.Metadata, &cortexpb.MetricMetadata{MetricFamilyName: "test", Help: "a help for metric", Unit: "", Type: cortexpb.COUNTER})
5740 _, err := i.Push(ctx, req)
5741 require.NoError(t, err)
5742}
5743
5744func pushSingleSampleAtTime(t *testing.T, i *Ingester, ts int64) {
5745 ctx := user.InjectOrgID(context.Background(), userID)

Calls 3

TimeToMillisFunction · 0.92
mockWriteRequestFunction · 0.70
PushMethod · 0.65

Tested by

no test coverage detected