MCPcopy Index your code
hub / github.com/flant/shell-operator / newBenchmarkTasksQueue

Function newBenchmarkTasksQueue

pkg/task/queue/task_queue_benchmark_test.go:145–156  ·  view source on GitHub ↗

* New code */

(b *testing.B)

Source from the content-addressed store, hash-verified

143/* New code */
144
145func newBenchmarkTasksQueue(b *testing.B) *TaskQueue {
146 metricStorage := metric.NewStorageMock(b)
147 metricStorage.HistogramObserveMock.Set(func(_ string, _ float64, _ map[string]string, _ []float64) {
148 // skip any observe hit
149 })
150 metricStorage.GaugeSetMock.Set(func(_ string, _ float64, _ map[string]string) {
151 })
152 metricStorage.CounterAddMock.Set(func(_ string, _ float64, _ map[string]string) {
153 })
154
155 return NewTasksQueue("test", metricStorage)
156}
157
158func BenchmarkTaskQueue_AddLast_100(b *testing.B) {
159 benchmarkAddLast(b, newBenchmarkTasksQueue(b), 100)

Calls 3

NewStorageMockFunction · 0.92
NewTasksQueueFunction · 0.85
SetMethod · 0.45

Tested by

no test coverage detected