Documentation ¶
Index ¶
- Variables
- func CloneTestData(t *testing.T) (string, func())
- func Dump(t *testing.T, i interface{})
- func LoadJSON(t *testing.T, path string, dst interface{})
- func Must(t *testing.T, err error)
- type TestOutput
- func (to *TestOutput) AddExtraDimension(key, value string)
- func (to *TestOutput) FlushDatapoints() []*datapoint.Datapoint
- func (to *TestOutput) FlushEvents() []*event.Event
- func (to *TestOutput) RemoveExtraDimension(key string)
- func (to *TestOutput) SendDatapoint(dp *datapoint.Datapoint)
- func (to *TestOutput) SendDimensionProps(dimProps *types.DimProperties)
- func (to *TestOutput) SendEvent(event *event.Event)
- func (to *TestOutput) SendSpan(span *trace.Span)
- func (to *TestOutput) WaitForDPs(count, waitSeconds int) []*datapoint.Datapoint
- func (to *TestOutput) WaitForDimensionProps(count, waitSeconds int) []*types.DimProperties
Constants ¶
This section is empty.
Variables ¶
var FixedTime func() time.Time
FixedTime is always at 2016-01-05T15:04:05-06:00
Functions ¶
func CloneTestData ¶
CloneTestData clones the test data into a temporary directory and changes the working directory to the temporary directory. The function returned should be run as a deferred to restore the working directory and remove the files.
Types ¶
type TestOutput ¶
type TestOutput struct {
// contains filtered or unexported fields
}
TestOutput can be used in place of the normal monitor outut to provide a simpler way of testing monitor output.
func NewTestOutput ¶
func NewTestOutput() *TestOutput
NewTestOutput creates a new initialized TestOutput instance
func (*TestOutput) AddExtraDimension ¶
func (to *TestOutput) AddExtraDimension(key, value string)
AddExtraDimension is a noop here
func (*TestOutput) FlushDatapoints ¶
func (to *TestOutput) FlushDatapoints() []*datapoint.Datapoint
FlushDatapoints returns all of the datapoints injected into the channel so far.
func (*TestOutput) FlushEvents ¶
func (to *TestOutput) FlushEvents() []*event.Event
FlushEvents returns all of the datapoints injected into the channel so far.
func (*TestOutput) RemoveExtraDimension ¶
func (to *TestOutput) RemoveExtraDimension(key string)
RemoveExtraDimension is a noop here
func (*TestOutput) SendDatapoint ¶
func (to *TestOutput) SendDatapoint(dp *datapoint.Datapoint)
SendDatapoint accepts a datapoint and sticks it in a buffered queue
func (*TestOutput) SendDimensionProps ¶
func (to *TestOutput) SendDimensionProps(dimProps *types.DimProperties)
SendDimensionProps accepts a dim prop update and sticks it in a buffered queue
func (*TestOutput) SendEvent ¶
func (to *TestOutput) SendEvent(event *event.Event)
SendEvent accepts an event and sticks it in a buffered queue
func (*TestOutput) SendSpan ¶
func (to *TestOutput) SendSpan(span *trace.Span)
SendSpan accepts a trace span and sticks it in a buffered queue
func (*TestOutput) WaitForDPs ¶
func (to *TestOutput) WaitForDPs(count, waitSeconds int) []*datapoint.Datapoint
WaitForDPs will keep pulling datapoints off of the internal queue until it either gets the expected count or waitSeconds seconds have elapsed. It then returns those datapoints. It will never return more than 'count' datapoints.
func (*TestOutput) WaitForDimensionProps ¶
func (to *TestOutput) WaitForDimensionProps(count, waitSeconds int) []*types.DimProperties
WaitForDimensionProps will keep pulling dimension property updates off of the internal queue until it either gets the expected count or waitSeconds seconds have elapsed. It then returns those dimension property updates. It will never return more than 'count' objects.