From 84c1d2b55ffc7d95116c6af6afca400b78e4c751 Mon Sep 17 00:00:00 2001 From: SungJin1212 Date: Tue, 5 Nov 2024 05:04:13 +0900 Subject: [PATCH] Fix BenchmarkDistributor_Push benchmark (#6309) Signed-off-by: SungJin1212 --- pkg/distributor/distributor_test.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/distributor/distributor_test.go b/pkg/distributor/distributor_test.go index 9e424e21b6..dce3d05c91 100644 --- a/pkg/distributor/distributor_test.go +++ b/pkg/distributor/distributor_test.go @@ -2209,7 +2209,7 @@ func BenchmarkDistributor_Push(b *testing.B) { require.NoError(b, err) // Start the distributor. - distributor, err := New(distributorCfg, clientConfig, overrides, ingestersRing, true, nil, log.NewNopLogger()) + distributor, err := New(distributorCfg, clientConfig, overrides, ingestersRing, true, prometheus.NewRegistry(), log.NewNopLogger()) require.NoError(b, err) require.NoError(b, services.StartAndAwaitRunning(context.Background(), distributor)) @@ -3315,6 +3315,10 @@ func (i *noopIngester) Close() error { return nil } +func (i *noopIngester) PushPreAlloc(ctx context.Context, in *cortexpb.PreallocWriteRequest, opts ...grpc.CallOption) (*cortexpb.WriteResponse, error) { + return nil, nil +} + func (i *noopIngester) Push(ctx context.Context, req *cortexpb.WriteRequest, opts ...grpc.CallOption) (*cortexpb.WriteResponse, error) { return nil, nil }