diff --git a/collect/cache/cuckooSentCache.go b/collect/cache/cuckooSentCache.go index e03ee8ba93..756569a889 100644 --- a/collect/cache/cuckooSentCache.go +++ b/collect/cache/cuckooSentCache.go @@ -170,7 +170,7 @@ func NewCuckooSentCache(cfg config.SampleCacheConfig, met metrics.Metrics) (Trac if err != nil { return nil, err } - dropped := NewCuckooTraceChecker(cfg.DroppedSize, met) + dropped := NewCuckooTraceChecker(cfg.DroppedSize, cfg.DroppedQueueSize, met) // we want to keep track of the most recent dropped traces so we can avoid // checking them in the dropped filter, which can have contention issues // under high load. So we use a cache with TTL to keep track of the most diff --git a/collect/cache/cuckoo_test.go b/collect/cache/cuckoo_test.go index 881a715448..9f7ffdc427 100644 --- a/collect/cache/cuckoo_test.go +++ b/collect/cache/cuckoo_test.go @@ -31,7 +31,7 @@ func BenchmarkCuckooTraceChecker_Add(b *testing.B) { traceIDs[i] = genID(32) } - c := NewCuckooTraceChecker(1000000, &metrics.NullMetrics{}) + c := NewCuckooTraceChecker(1000000, 10000, &metrics.NullMetrics{}) b.ResetTimer() for i := 0; i < b.N; i++ { c.Add(traceIDs[i]) @@ -57,7 +57,7 @@ func BenchmarkCuckooTraceChecker_AddParallel(b *testing.B) { } }) - c := NewCuckooTraceChecker(1000000, &metrics.NullMetrics{}) + c := NewCuckooTraceChecker(1000000, 10000, &metrics.NullMetrics{}) ch := make(chan int, numGoroutines) for i := 0; i < numGoroutines; i++ { p.Go(func() { @@ -89,7 +89,7 @@ func BenchmarkCuckooTraceChecker_Check(b *testing.B) { traceIDs[i] = genID(32) } - c := NewCuckooTraceChecker(1000000, &metrics.NullMetrics{}) + c := NewCuckooTraceChecker(1000000, 10000, &metrics.NullMetrics{}) // add every other one to the filter for i := 0; i < b.N; i += 2 { if i%10000 == 0 { @@ -111,7 +111,7 @@ func BenchmarkCuckooTraceChecker_CheckParallel(b *testing.B) { traceIDs[i] = genID(32) } - c := NewCuckooTraceChecker(1000000, &metrics.NullMetrics{}) + c := NewCuckooTraceChecker(1000000, 10000, &metrics.NullMetrics{}) for i := 0; i < b.N; i += 2 { if i%10000 == 0 { c.Maintain() @@ -165,7 +165,7 @@ func BenchmarkCuckooTraceChecker_CheckAddParallel(b *testing.B) { met := &metrics.MockMetrics{} met.Start() - c := NewCuckooTraceChecker(1000000, met) + c := NewCuckooTraceChecker(1000000, 10000, met) const numCheckers = 30 const numAdders = 30