Documentation ¶
Overview ¶
Package mockoutput implements a mock output for testing purposes.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockOutput ¶
type MockOutput struct { SampleContainers []metrics.SampleContainer Samples []metrics.Sample DescFn func() string StartFn func() error StopFn func() error }
MockOutput can be used in tests to mock an actual output.
func New ¶
func New() *MockOutput
New exists so that the usage from tests avoids repetition, i.e. is mockoutput.New() instead of &mockoutput.MockOutput{}
func (*MockOutput) AddMetricSamples ¶
func (mo *MockOutput) AddMetricSamples(scs []metrics.SampleContainer)
AddMetricSamples just saves the results in memory.
func (*MockOutput) Description ¶
func (mo *MockOutput) Description() string
Description calls the supplied DescFn callback, if available.
func (*MockOutput) Start ¶
func (mo *MockOutput) Start() error
Start calls the supplied StartFn callback, if available.
func (*MockOutput) Stop ¶
func (mo *MockOutput) Stop() error
Stop calls the supplied StopFn callback, if available.
Click to show internal directories.
Click to hide internal directories.