2019-07-12 00:28:38 +02:00
|
|
|
package metric
|
|
|
|
|
|
|
|
import (
|
|
|
|
"context"
|
|
|
|
|
2019-07-15 23:49:21 +02:00
|
|
|
"go.opentelemetry.io/api/core"
|
2019-07-12 00:28:38 +02:00
|
|
|
)
|
|
|
|
|
2019-10-09 00:45:49 +02:00
|
|
|
type noopMeter struct{}
|
|
|
|
type noopHandle struct{}
|
|
|
|
type noopLabelSet struct{}
|
2019-10-23 08:29:24 +02:00
|
|
|
type noopInstrument struct{}
|
2019-07-12 00:28:38 +02:00
|
|
|
|
2019-10-09 00:45:49 +02:00
|
|
|
var _ Meter = noopMeter{}
|
2019-10-23 08:29:24 +02:00
|
|
|
var _ Instrument = noopInstrument{}
|
2019-10-09 00:45:49 +02:00
|
|
|
var _ Handle = noopHandle{}
|
|
|
|
var _ LabelSet = noopLabelSet{}
|
2019-07-12 00:28:38 +02:00
|
|
|
|
2019-10-09 00:45:49 +02:00
|
|
|
func (noopHandle) RecordOne(context.Context, MeasurementValue) {
|
|
|
|
}
|
|
|
|
|
2019-10-23 08:29:24 +02:00
|
|
|
func (noopHandle) Release() {
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopInstrument) AcquireHandle(LabelSet) Handle {
|
|
|
|
return noopHandle{}
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopInstrument) RecordOne(context.Context, MeasurementValue, LabelSet) {
|
|
|
|
}
|
|
|
|
|
2019-10-09 00:45:49 +02:00
|
|
|
func (noopLabelSet) Meter() Meter {
|
|
|
|
return noopMeter{}
|
|
|
|
}
|
|
|
|
|
2019-10-23 08:29:24 +02:00
|
|
|
func (noopMeter) Labels(context.Context, ...core.KeyValue) LabelSet {
|
2019-10-09 00:45:49 +02:00
|
|
|
return noopLabelSet{}
|
|
|
|
}
|
2019-07-12 00:28:38 +02:00
|
|
|
|
2019-10-23 08:29:24 +02:00
|
|
|
func (noopMeter) NewInt64Counter(name string, cos ...CounterOptionApplier) Int64Counter {
|
|
|
|
return WrapInt64CounterInstrument(noopInstrument{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopMeter) NewFloat64Counter(name string, cos ...CounterOptionApplier) Float64Counter {
|
|
|
|
return WrapFloat64CounterInstrument(noopInstrument{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopMeter) NewInt64Gauge(name string, gos ...GaugeOptionApplier) Int64Gauge {
|
|
|
|
return WrapInt64GaugeInstrument(noopInstrument{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopMeter) NewFloat64Gauge(name string, gos ...GaugeOptionApplier) Float64Gauge {
|
|
|
|
return WrapFloat64GaugeInstrument(noopInstrument{})
|
|
|
|
}
|
|
|
|
|
|
|
|
func (noopMeter) NewInt64Measure(name string, mos ...MeasureOptionApplier) Int64Measure {
|
|
|
|
return WrapInt64MeasureInstrument(noopInstrument{})
|
2019-10-09 00:45:49 +02:00
|
|
|
}
|
|
|
|
|
2019-10-23 08:29:24 +02:00
|
|
|
func (noopMeter) NewFloat64Measure(name string, mos ...MeasureOptionApplier) Float64Measure {
|
|
|
|
return WrapFloat64MeasureInstrument(noopInstrument{})
|
2019-10-09 00:45:49 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
func (noopMeter) RecordBatch(context.Context, LabelSet, ...Measurement) {
|
|
|
|
}
|