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

Function createCortexRemoteWriteV2Protobuf

pkg/util/push/push_test.go:1172–1194  ·  view source on GitHub ↗
(t *testing.T, skipLabelNameValidation bool, source cortexpb.SourceEnum)

Source from the content-addressed store, hash-verified

1170}
1171
1172func createCortexRemoteWriteV2Protobuf(t *testing.T, skipLabelNameValidation bool, source cortexpb.SourceEnum) []byte {
1173 t.Helper()
1174
1175 input := cortexpb.WriteRequestV2{
1176 Symbols: []string{"", "__name__", "foo"},
1177 Timeseries: []cortexpb.PreallocTimeseriesV2{
1178 {
1179 TimeSeriesV2: &cortexpb.TimeSeriesV2{
1180 LabelsRefs: []uint32{1, 2},
1181 Samples: []cortexpb.Sample{
1182 {Value: 1, TimestampMs: time.Date(2020, 4, 1, 0, 0, 0, 0, time.UTC).UnixNano()},
1183 },
1184 },
1185 },
1186 },
1187 Source: source,
1188 SkipLabelNameValidation: skipLabelNameValidation,
1189 }
1190
1191 inoutBytes, err := input.Marshal()
1192 require.NoError(t, err)
1193 return inoutBytes
1194}
1195
1196func createPrometheusRemoteWriteV2Protobuf(t *testing.T) []byte {
1197 t.Helper()

Calls 1

MarshalMethod · 0.95

Tested by

no test coverage detected