Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions pkg/epp/flowcontrol/contracts/mocks/mocks.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ func (m *MockEndpointCandidates) Locate(ctx context.Context, requestMetadata map
// It is used for tests that need to control the exact return values of a queue's methods without simulating the queue's
// internal logic or state.
type MockSafeQueue struct {
NameV string
LenV int
ByteSizeV uint64
PeekV flowcontrol.QueueItemAccessor
Expand All @@ -169,7 +168,6 @@ type MockSafeQueue struct {
DrainFunc func() []flowcontrol.QueueItemAccessor
}

func (m *MockSafeQueue) Name() string { return m.NameV }
func (m *MockSafeQueue) Len() int { return m.LenV }
func (m *MockSafeQueue) ByteSize() uint64 { return m.ByteSizeV }

Expand Down Expand Up @@ -330,7 +328,6 @@ func (m *MockManagedQueue) Drain() []flowcontrol.QueueItemAccessor {
}

func (m *MockManagedQueue) FlowKey() flowcontrol.FlowKey { return m.FlowKeyV }
func (m *MockManagedQueue) Name() string { return "" }
func (m *MockManagedQueue) OrderingPolicy() flowcontrol.OrderingPolicy {
if m.OrderingPolicyFunc != nil {
return m.OrderingPolicyFunc()
Expand Down
36 changes: 15 additions & 21 deletions pkg/epp/flowcontrol/framework/plugins/queue/benchmark_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,33 +28,27 @@ import (

var benchmarkFlowKey = flowcontrol.FlowKey{ID: "benchmark-flow"}

// BenchmarkQueues runs a series of benchmarks against all registered queue implementations.
// BenchmarkQueues runs a series of benchmarks against the priority queue implementation.
func BenchmarkQueues(b *testing.B) {
for queueName, constructor := range RegisteredQueues {
b.Run(string(queueName), func(b *testing.B) {
// All queue implementations must support the default enqueue time comparator.
q, err := constructor(enqueueTimePolicy)
if err != nil {
b.Fatalf("Failed to construct queue '%s': %v", queueName, err)
}
b.Run(PriorityQueueName, func(b *testing.B) {
q := New(enqueueTimePolicy)

b.Run("AddRemove", func(b *testing.B) {
benchmarkAddRemove(b, q)
})
b.Run("AddRemove", func(b *testing.B) {
benchmarkAddRemove(b, q)
})

b.Run("AddPeekRemove", func(b *testing.B) {
benchmarkAddPeekRemove(b, q)
})
b.Run("AddPeekRemove", func(b *testing.B) {
benchmarkAddPeekRemove(b, q)
})

b.Run("BulkAddThenBulkRemove", func(b *testing.B) {
benchmarkBulkAddThenBulkRemove(b, q)
})
b.Run("BulkAddThenBulkRemove", func(b *testing.B) {
benchmarkBulkAddThenBulkRemove(b, q)
})

b.Run("HighContention", func(b *testing.B) {
benchmarkHighContention(b, q)
})
b.Run("HighContention", func(b *testing.B) {
benchmarkHighContention(b, q)
})
}
})
}

// benchmarkAddRemove measures the throughput of tightly coupled Add and Remove operations in parallel. This is a good
Expand Down
64 changes: 0 additions & 64 deletions pkg/epp/flowcontrol/framework/plugins/queue/factory.go

This file was deleted.

Loading
Loading