Source File
sync.go
Belonging Package
go.opentelemetry.io/otel/api/metric
package metric
import (
)
var ErrSDKReturnedNilImpl = errors.New("SDK returned a nil implementation")
type syncInstrument struct {
instrument SyncImpl
}
type syncBoundInstrument struct {
boundInstrument BoundSyncImpl
}
type asyncInstrument struct {
instrument AsyncImpl
}
func ( Measurement) () SyncImpl {
return .instrument
}
func ( Measurement) () Number {
return .number
}
func ( Observation) () AsyncImpl {
return .instrument
}
func ( Observation) () Number {
return .number
}
func ( asyncInstrument) () AsyncImpl {
return .instrument
}
func ( syncInstrument) () SyncImpl {
return .instrument
}
func ( syncInstrument) ( []label.KeyValue) syncBoundInstrument {
return newSyncBoundInstrument(.instrument.Bind())
}
func ( syncInstrument) ( float64) Measurement {
return newMeasurement(.instrument, NewFloat64Number())
}
func ( syncInstrument) ( int64) Measurement {
return newMeasurement(.instrument, NewInt64Number())
}
func ( syncInstrument) ( context.Context, Number, []label.KeyValue) {
.instrument.RecordOne(, , )
}
func ( syncBoundInstrument) ( context.Context, Number) {
.boundInstrument.RecordOne(, )
}
func ( syncBoundInstrument) () {
.boundInstrument.Unbind()
}
func ( AsyncImpl, error) (asyncInstrument, error) {
if == nil {
if == nil {
= ErrSDKReturnedNilImpl
}
= NoopAsync{}
}
return asyncInstrument{
instrument: ,
},
}
func ( SyncImpl, error) (syncInstrument, error) {
if == nil {
if == nil {
= ErrSDKReturnedNilImpl
= NoopSync{}
}
return syncInstrument{
instrument: ,
},
}
func ( BoundSyncImpl) syncBoundInstrument {
return syncBoundInstrument{
boundInstrument: ,
}
}
func ( SyncImpl, Number) Measurement {
return Measurement{
instrument: ,
number: ,
}
}
func ( SyncImpl, error) (Int64Counter, error) {
, := checkNewSync(, )
return Int64Counter{syncInstrument: },
}
func ( SyncImpl, error) (Float64Counter, error) {
, := checkNewSync(, )
return Float64Counter{syncInstrument: },
}
func ( SyncImpl, error) (Int64UpDownCounter, error) {
, := checkNewSync(, )
return Int64UpDownCounter{syncInstrument: },
}
func ( SyncImpl, error) (Float64UpDownCounter, error) {
, := checkNewSync(, )
return Float64UpDownCounter{syncInstrument: },
}
func ( SyncImpl, error) (Int64ValueRecorder, error) {
, := checkNewSync(, )
return Int64ValueRecorder{syncInstrument: },
}
func ( SyncImpl, error) (Float64ValueRecorder, error) {
, := checkNewSync(, )
return Float64ValueRecorder{syncInstrument: },
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |