1package metric
2
3import (
4	"context"
5
6	"go.opentelemetry.io/otel/api/core"
7)
8
9type NoopProvider struct{}
10type NoopMeter struct{}
11type noopBoundInstrument struct{}
12type noopLabelSet struct{}
13type noopInstrument struct{}
14
15var _ Provider = NoopProvider{}
16var _ Meter = NoopMeter{}
17var _ InstrumentImpl = noopInstrument{}
18var _ BoundInstrumentImpl = noopBoundInstrument{}
19var _ LabelSet = noopLabelSet{}
20
21func (NoopProvider) Meter(name string) Meter {
22	return NoopMeter{}
23}
24
25func (noopBoundInstrument) RecordOne(context.Context, core.Number) {
26}
27
28func (noopBoundInstrument) Unbind() {
29}
30
31func (noopInstrument) Bind(LabelSet) BoundInstrumentImpl {
32	return noopBoundInstrument{}
33}
34
35func (noopInstrument) RecordOne(context.Context, core.Number, LabelSet) {
36}
37
38func (noopInstrument) Meter() Meter {
39	return NoopMeter{}
40}
41
42func (NoopMeter) Labels(...core.KeyValue) LabelSet {
43	return noopLabelSet{}
44}
45
46func (NoopMeter) NewInt64Counter(name string, cos ...CounterOptionApplier) Int64Counter {
47	return WrapInt64CounterInstrument(noopInstrument{})
48}
49
50func (NoopMeter) NewFloat64Counter(name string, cos ...CounterOptionApplier) Float64Counter {
51	return WrapFloat64CounterInstrument(noopInstrument{})
52}
53
54func (NoopMeter) NewInt64Gauge(name string, gos ...GaugeOptionApplier) Int64Gauge {
55	return WrapInt64GaugeInstrument(noopInstrument{})
56}
57
58func (NoopMeter) NewFloat64Gauge(name string, gos ...GaugeOptionApplier) Float64Gauge {
59	return WrapFloat64GaugeInstrument(noopInstrument{})
60}
61
62func (NoopMeter) NewInt64Measure(name string, mos ...MeasureOptionApplier) Int64Measure {
63	return WrapInt64MeasureInstrument(noopInstrument{})
64}
65
66func (NoopMeter) NewFloat64Measure(name string, mos ...MeasureOptionApplier) Float64Measure {
67	return WrapFloat64MeasureInstrument(noopInstrument{})
68}
69
70func (NoopMeter) RecordBatch(context.Context, LabelSet, ...Measurement) {
71}
72