mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2024-12-12 10:04:29 +02:00
388d3248fe
* prevent passing observer descriptors to NewHandle * add some test for metrics * reword some docs
43 lines
797 B
Go
43 lines
797 B
Go
package metric
|
|
|
|
import (
|
|
"context"
|
|
|
|
"go.opentelemetry.io/api/core"
|
|
)
|
|
|
|
type noopMeter struct{}
|
|
type noopHandle struct{}
|
|
type noopLabelSet struct{}
|
|
|
|
var _ Meter = noopMeter{}
|
|
var _ Handle = noopHandle{}
|
|
var _ LabelSet = noopLabelSet{}
|
|
|
|
func (noopHandle) RecordOne(context.Context, MeasurementValue) {
|
|
}
|
|
|
|
func (noopLabelSet) Meter() Meter {
|
|
return noopMeter{}
|
|
}
|
|
|
|
func (noopMeter) DefineLabels(context.Context, ...core.KeyValue) LabelSet {
|
|
return noopLabelSet{}
|
|
}
|
|
|
|
func (noopMeter) NewHandle(ExplicitReportingMetric, LabelSet) Handle {
|
|
return noopHandle{}
|
|
}
|
|
|
|
func (noopMeter) DeleteHandle(Handle) {
|
|
}
|
|
|
|
func (noopMeter) RecordBatch(context.Context, LabelSet, ...Measurement) {
|
|
}
|
|
|
|
func (noopMeter) RegisterObserver(Observer, ObserverCallback) {
|
|
}
|
|
|
|
func (noopMeter) UnregisterObserver(Observer) {
|
|
}
|