Copyright The OpenTelemetry Authors Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

package metric

import (
	
	

	
)
ErrSDKReturnedNilImpl is returned when a new `MeterImpl` returns nil.
var ErrSDKReturnedNilImpl = errors.New("SDK returned a nil implementation")
Measurement is used for reporting a synchronous batch of metric values. Instances of this type should be created by synchronous instruments (e.g., Int64Counter.Measurement()).
number needs to be aligned for 64-bit atomic operations.
syncInstrument contains a SyncImpl.
syncBoundInstrument contains a BoundSyncImpl.
asyncInstrument contains a AsyncImpl.
SyncImpl returns the instrument that created this measurement. This returns an implementation-level object for use by the SDK, users should not refer to this.
func ( Measurement) () SyncImpl {
	return .instrument
}
Number returns a number recorded in this measurement.
func ( Measurement) () Number {
	return .number
}
AsyncImpl returns the instrument that created this observation. This returns an implementation-level object for use by the SDK, users should not refer to this.
func ( Observation) () AsyncImpl {
	return .instrument
}
Number returns a number recorded in this observation.
func ( Observation) () Number {
	return .number
}
AsyncImpl implements AsyncImpl.
SyncImpl returns the implementation object for synchronous instruments.
Unbind calls SyncImpl.Unbind.
checkNewAsync receives an AsyncImpl and potential error, and returns the same types, checking for and ensuring that the returned interface is not nil.
func ( AsyncImpl,  error) (asyncInstrument, error) {
	if  == nil {
		if  == nil {
			 = ErrSDKReturnedNilImpl
		}
		 = NoopAsync{}
	}
	return asyncInstrument{
		instrument: ,
	}, 
}
checkNewSync receives an SyncImpl and potential error, and returns the same types, checking for and ensuring that the returned interface is not nil.
func ( SyncImpl,  error) (syncInstrument, error) {
	if  == nil {
		if  == nil {
			 = ErrSDKReturnedNilImpl
Note: an alternate behavior would be to synthesize a new name or group all duplicately-named instruments of a certain type together and use a tag for the original name, e.g., name = 'invalid.counter.int64' label = 'original-name=duplicate-counter-name'
		 = NoopSync{}
	}
	return syncInstrument{
		instrument: ,
	}, 
}

func ( BoundSyncImpl) syncBoundInstrument {
	return syncBoundInstrument{
		boundInstrument: ,
	}
}

func ( SyncImpl,  Number) Measurement {
	return Measurement{
		instrument: ,
		number:     ,
	}
}
wrapInt64CounterInstrument converts a SyncImpl into Int64Counter.
func ( SyncImpl,  error) (Int64Counter, error) {
	,  := checkNewSync(, )
	return Int64Counter{syncInstrument: }, 
}
wrapFloat64CounterInstrument converts a SyncImpl into Float64Counter.
func ( SyncImpl,  error) (Float64Counter, error) {
	,  := checkNewSync(, )
	return Float64Counter{syncInstrument: }, 
}
wrapInt64UpDownCounterInstrument converts a SyncImpl into Int64UpDownCounter.
func ( SyncImpl,  error) (Int64UpDownCounter, error) {
	,  := checkNewSync(, )
	return Int64UpDownCounter{syncInstrument: }, 
}
wrapFloat64UpDownCounterInstrument converts a SyncImpl into Float64UpDownCounter.
func ( SyncImpl,  error) (Float64UpDownCounter, error) {
	,  := checkNewSync(, )
	return Float64UpDownCounter{syncInstrument: }, 
}
wrapInt64ValueRecorderInstrument converts a SyncImpl into Int64ValueRecorder.
func ( SyncImpl,  error) (Int64ValueRecorder, error) {
	,  := checkNewSync(, )
	return Int64ValueRecorder{syncInstrument: }, 
}
wrapFloat64ValueRecorderInstrument converts a SyncImpl into Float64ValueRecorder.
func ( SyncImpl,  error) (Float64ValueRecorder, error) {
	,  := checkNewSync(, )
	return Float64ValueRecorder{syncInstrument: },