Debian Codegraph @

service/internal/obsconsumer/enabled_test.go

raw
1 // Copyright The OpenTelemetry Authors
2 // SPDX-License-Identifier: Apache-2.0
3
4 package obsconsumer_test
5
6 import (
7 "context"
8
9 "go.opentelemetry.io/otel/metric"
10 )
11
12 type disabledCounter struct {
13 metric.Int64Counter
14 }
15
16 func newDisabledCounter(embedded metric.Int64Counter) *disabledCounter {
17 return &disabledCounter{Int64Counter: embedded}
18 }
19
20 func (m *disabledCounter) Enabled(context.Context) bool {
21 return false
22 }
23
24 func (m *disabledCounter) Add(ctx context.Context, value int64, opts ...metric.AddOption) {
25 m.Int64Counter.Add(ctx, value, opts...)
26 }