otesting

package
v2.3.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MeterProvider

func MeterProvider() metric.MeterProvider

Types

type TestAFInstrumentProvider

type TestAFInstrumentProvider struct{}

func (TestAFInstrumentProvider) Counter

Counter creates an instrument for recording increasing values.

func (TestAFInstrumentProvider) Gauge

Gauge creates an instrument for recording the current value.

func (TestAFInstrumentProvider) UpDownCounter

UpDownCounter creates an instrument for recording changes of a value.

type TestAIInstrumentProvider

type TestAIInstrumentProvider struct{}

func (TestAIInstrumentProvider) Counter

Counter creates an instrument for recording increasing values.

func (TestAIInstrumentProvider) Gauge

Gauge creates an instrument for recording the current value.

func (TestAIInstrumentProvider) UpDownCounter

func (ip TestAIInstrumentProvider) UpDownCounter(name string, opts ...instrument.Option) (asyncint64.UpDownCounter, error)

UpDownCounter creates an instrument for recording changes of a value.

type TestCountingFloatInstrument

type TestCountingFloatInstrument struct {
	Count int

	instrument.Asynchronous
	instrument.Synchronous
}

func (*TestCountingFloatInstrument) Add

func (*TestCountingFloatInstrument) Observe

func (*TestCountingFloatInstrument) Record

type TestCountingIntInstrument

type TestCountingIntInstrument struct {
	Count int

	instrument.Asynchronous
	instrument.Synchronous
}

func (*TestCountingIntInstrument) Add

func (*TestCountingIntInstrument) Observe

func (*TestCountingIntInstrument) Record

type TestMeter

type TestMeter struct {
	AfCount int
	AiCount int
	SfCount int
	SiCount int

	Callbacks []func(context.Context)
}

func (*TestMeter) AsyncFloat64

func (m *TestMeter) AsyncFloat64() asyncfloat64.InstrumentProvider

AsyncFloat64 is the namespace for the Asynchronous Float instruments

To Observe data with instruments it must be registered in a callback.

func (*TestMeter) AsyncInt64

func (m *TestMeter) AsyncInt64() asyncint64.InstrumentProvider

AsyncInt64 is the namespace for the Asynchronous Integer instruments.

To Observe data with instruments it must be registered in a callback.

func (*TestMeter) RegisterCallback

func (m *TestMeter) RegisterCallback(insts []instrument.Asynchronous, function func(context.Context)) error

RegisterCallback captures the function that will be called during Collect.

It is only valid to call Observe within the scope of the passed function, and only on the instruments that were registered with this call.

func (*TestMeter) SyncFloat64

func (m *TestMeter) SyncFloat64() syncfloat64.InstrumentProvider

SyncFloat64 is the namespace for the Synchronous Float instruments.

func (*TestMeter) SyncInt64

func (m *TestMeter) SyncInt64() syncint64.InstrumentProvider

SyncInt64 is the namespace for the Synchronous Integer instruments.

type TestMeterProvider

type TestMeterProvider struct {
	Count int
}

func (*TestMeterProvider) Meter

func (p *TestMeterProvider) Meter(name string, opts ...metric.MeterOption) metric.Meter

type TestSIInstrumentProvider

type TestSIInstrumentProvider struct{}

func (TestSIInstrumentProvider) Counter

Counter creates an instrument for recording increasing values.

func (TestSIInstrumentProvider) Histogram

func (ip TestSIInstrumentProvider) Histogram(name string, opts ...instrument.Option) (syncint64.Histogram, error)

Histogram creates an instrument for recording a distribution of values.

func (TestSIInstrumentProvider) UpDownCounter

func (ip TestSIInstrumentProvider) UpDownCounter(name string, opts ...instrument.Option) (syncint64.UpDownCounter, error)

UpDownCounter creates an instrument for recording changes of a value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL