Skip to content

Commit bebe12f

Browse files
authored
verify native histograms pass with rate.Inf and zero burst (#7662)
Signed-off-by: SungJin1212 <tjdwls1201@gmail.com>
1 parent 286e534 commit bebe12f

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

‎pkg/distributor/distributor_test.go‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ import (
3232
"github.com/weaveworks/common/httpgrpc"
3333
"github.com/weaveworks/common/user"
3434
"go.uber.org/atomic"
35+
"golang.org/x/time/rate"
3536
"google.golang.org/grpc"
3637
"google.golang.org/grpc/health/grpc_health_v1"
3738
"google.golang.org/grpc/status"
@@ -927,6 +928,18 @@ func TestDistributor_PushIngestionRateLimiter_Histograms(t *testing.T) {
927928
{samples: 3, nhSamples: 3, metadata: 2, expectedError: nil},
928929
},
929930
},
931+
"local strategy: unlimited native histogram rate (Inf) with zero burst should always accept NH samples": {
932+
distributors: 1,
933+
ingestionRateStrategy: validation.LocalIngestionRateStrategy,
934+
ingestionRate: 100000,
935+
ingestionBurstSize: 100000,
936+
nativeHistogramIngestionRate: float64(rate.Inf),
937+
nativeHistogramIngestionBurstSize: 0,
938+
pushes: []testPush{
939+
{nhSamples: 1000, expectedError: nil, expectedNHDiscardedSampleMetricValue: 0},
940+
{nhSamples: 5000, expectedError: nil, expectedNHDiscardedSampleMetricValue: 0},
941+
},
942+
},
930943
}
931944

932945
for testName, testData := range tests {

0 commit comments

Comments
 (0)