package controllertest
import "go.opentelemetry.io/otel/sdk/metric/controller/controllertest"
Index ¶
- func ReadAll( reader export.InstrumentationLibraryReader, kind aggregation.TemporalitySelector, apply func(instrumentation.Library, export.Record) error, ) error
- type MockClock
- func NewMockClock() MockClock
- func (c MockClock) Add(d time.Duration)
- func (c MockClock) Now() time.Time
- func (c MockClock) Ticker(period time.Duration) controllerTime.Ticker
- type MockTicker
Functions ¶
func ReadAll ¶
func ReadAll( reader export.InstrumentationLibraryReader, kind aggregation.TemporalitySelector, apply func(instrumentation.Library, export.Record) error, ) error
ReadAll is a helper for tests that want a flat iterator over all metrics instead of a two-level iterator (instrumentation library, metric).
Types ¶
type MockClock ¶
type MockClock struct {
// contains filtered or unexported fields
}
MockClock is a Clock used for testing.
func NewMockClock ¶
func NewMockClock() MockClock
NewMockClock returns a new unset MockClock.
func (MockClock) Add ¶
Add moves the current time of the MockClock forward by the specified duration.
func (MockClock) Now ¶
Now returns the current time.
func (MockClock) Ticker ¶
func (c MockClock) Ticker(period time.Duration) controllerTime.Ticker
Ticker creates a new instance of a Ticker.
type MockTicker ¶
type MockTicker struct {
// contains filtered or unexported fields
}
MockTicker is a Ticker used for testing.
func (MockTicker) C ¶
func (t MockTicker) C() <-chan time.Time
C returns a channel that receives the current time when MockTicker ticks.
func (MockTicker) Stop ¶
func (t MockTicker) Stop()
Stop turns off the MockTicker.
Source Files ¶
test.go
- Version
- v0.31.0
- Published
- Jul 8, 2022
- Platform
- js/wasm
- Imports
- 6 packages
- Last checked
- 2 days ago –
Tools for package owners.