1
// Copyright Istio Authors
3
// Licensed under the Apache License, Version 2.0 (the "License");
4
// you may not use this file except in compliance with the License.
5
// You may obtain a copy of the License at
7
// http://www.apache.org/licenses/LICENSE-2.0
9
// Unless required by applicable law or agreed to in writing, software
10
// distributed under the License is distributed on an "AS IS" BASIS,
11
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
// See the License for the specific language governing permissions and
13
// limitations under the License.
21
"istio.io/istio/pilot/pkg/features"
24
func BenchmarkMetricsQueue(b *testing.B) {
25
features.EnableControllerQueueMetrics = true
26
q := NewQueue(1 * time.Microsecond)
27
s := make(chan struct{})
29
for n := 0; n < b.N; n++ {
30
wg := sync.WaitGroup{}
42
func BenchmarkMetricsQueueDisabled(b *testing.B) {
43
features.EnableControllerQueueMetrics = false
44
q := NewQueue(1 * time.Microsecond)
45
s := make(chan struct{})
47
for n := 0; n < b.N; n++ {
48
wg := sync.WaitGroup{}
59
func BenchmarkMetricsQueueInc(b *testing.B) {
60
q := newQueueMetrics("test")
61
for n := 0; n < b.N; n++ {
66
func BenchmarkMetricsQueueRec(b *testing.B) {
67
q := newQueueMetrics("test")
68
for n := 0; n < b.N; n++ {
73
func BenchmarkMetricsQueueSinceInSeconds(b *testing.B) {
74
q := newQueueMetrics("test")
76
for n := 0; n < b.N; n++ {