nolint: revive
(ctx context.Context, t testing.TB, client *kgo.Client, encode encodingFn, opts ReqOpts)
| 47 | |
| 48 | // nolint: revive |
| 49 | func SendReqWithOpts(ctx context.Context, t testing.TB, client *kgo.Client, encode encodingFn, opts ReqOpts) []*kgo.Record { |
| 50 | traceID := generateTraceID(t) |
| 51 | opts.applyDefaults() |
| 52 | |
| 53 | startTime := uint64(opts.Time.UnixNano()) |
| 54 | endTime := uint64(opts.Time.Add(time.Second).UnixNano()) |
| 55 | req := test.MakePushBytesRequest(t, 10, traceID, startTime, endTime) |
| 56 | records, err := encode(opts.Partition, opts.TenantID, req, 1_000_000) |
| 57 | require.NoError(t, err) |
| 58 | |
| 59 | res := client.ProduceSync(ctx, records...) |
| 60 | require.NoError(t, res.FirstErr()) |
| 61 | |
| 62 | return records |
| 63 | } |
| 64 | |
| 65 | func SendReq(ctx context.Context, t testing.TB, client *kgo.Client, encode encodingFn, tenantID string) []*kgo.Record { |
| 66 | return SendReqWithOpts(ctx, t, client, encode, ReqOpts{Partition: 0, Time: time.Now(), TenantID: tenantID}) |