Skip to content

Commit

Permalink
acutally pass in the config value
Browse files Browse the repository at this point in the history
  • Loading branch information
VinozzZ committed Jan 21, 2025
1 parent 1f54e9a commit e37a9c9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion collect/cache/cuckooSentCache.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions collect/cache/cuckoo_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand All @@ -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() {
Expand Down Expand Up @@ -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 {
Expand All @@ -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()
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit e37a9c9

Please sign in to comment.