exportertest

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 3, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewNopMetricsExporter

func NewNopMetricsExporter(options ...NopExporterOption) exporter.MetricsExporter

NewNopMetricsExporter creates an MetricsExporter that just drops the received data.

func NewNopTraceExporter

func NewNopTraceExporter(options ...NopExporterOption) exporter.TraceExporter

NewNopTraceExporter creates an TraceExporter that just drops the received data.

func ToJSON

func ToJSON(v interface{}) []byte

ToJSON marshals a generic interface to JSON to enable easy comparisons.

Types

type NopExporterOption

type NopExporterOption func(*nopExporter)

NopExporterOption represents options that can be applied to a NopExporter.

func WithReturnError

func WithReturnError(retError error) NopExporterOption

WithReturnError returns a NopExporterOption that enforces the nop Exporters to return the given error.

type SinkMetricsExporter

type SinkMetricsExporter struct {
	// contains filtered or unexported fields
}

SinkMetricsExporter acts as a metrics receiver for use in tests.

func (*SinkMetricsExporter) AllMetrics

func (sme *SinkMetricsExporter) AllMetrics() []consumerdata.MetricsData

AllMetrics returns the metrics sent to the test sink.

func (*SinkMetricsExporter) ConsumeMetricsData

func (sme *SinkMetricsExporter) ConsumeMetricsData(ctx context.Context, md consumerdata.MetricsData) error

ConsumeMetricsData stores traces for tests.

func (*SinkMetricsExporter) Name

func (sme *SinkMetricsExporter) Name() string

Name returns the name of this MetricsExporter.

func (*SinkMetricsExporter) Shutdown

func (sme *SinkMetricsExporter) Shutdown() error

Shutdown stops the exporter and is invoked during shutdown.

type SinkTraceExporter

type SinkTraceExporter struct {
	// contains filtered or unexported fields
}

SinkTraceExporter acts as a trace receiver for use in tests.

func (*SinkTraceExporter) AllTraces

func (ste *SinkTraceExporter) AllTraces() []consumerdata.TraceData

AllTraces returns the traces sent to the test sink.

func (*SinkTraceExporter) ConsumeTraceData

func (ste *SinkTraceExporter) ConsumeTraceData(ctx context.Context, td consumerdata.TraceData) error

ConsumeTraceData stores traces for tests.

func (*SinkTraceExporter) Name

func (ste *SinkTraceExporter) Name() string

Name returns the name of this TraceExporter.

func (*SinkTraceExporter) Shutdown

func (ste *SinkTraceExporter) Shutdown() error

Shutdown stops the exporter and is invoked during shutdown.

Jump to

Keyboard shortcuts

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