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

Function createPrometheusRemoteWriteProtobuf

pkg/util/push/push_test.go:1215–1232  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1213}
1214
1215func createPrometheusRemoteWriteProtobuf(t *testing.T) []byte {
1216 t.Helper()
1217 input := prompb.WriteRequest{
1218 Timeseries: []prompb.TimeSeries{
1219 {
1220 Labels: []prompb.Label{
1221 {Name: "__name__", Value: "foo"},
1222 },
1223 Samples: []prompb.Sample{
1224 {Value: 1, Timestamp: time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC).UnixNano()},
1225 },
1226 },
1227 },
1228 }
1229 inoutBytes, err := input.Marshal()
1230 require.NoError(t, err)
1231 return inoutBytes
1232}
1233func createCortexWriteRequestProtobuf(t *testing.T, skipLabelNameValidation bool, source cortexpb.SourceEnum) []byte {
1234 t.Helper()
1235 ts := cortexpb.PreallocTimeseries{

Callers 2

TestHandler_remoteWriteFunction · 0.85

Calls 1

MarshalMethod · 0.95

Tested by

no test coverage detected