testutils

package
v1.29.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewJaegerThriftUDPClient

func NewJaegerThriftUDPClient(hostPort string, protocolFactory thrift.TProtocolFactory) (*agent.AgentClient, io.Closer, error)

NewJaegerThriftUDPClient creates a new jaeger agent client that works like Jaeger client

func NewZipkinThriftUDPClient

func NewZipkinThriftUDPClient(hostPort string) (*agent.AgentClient, io.Closer, error)

NewZipkinThriftUDPClient creates a new zipking agent client that works like Jaeger client

Types

type GrpcCollector added in v1.19.0

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

GrpcCollector is a mock collector for tests

func StartGRPCCollector added in v1.19.0

func StartGRPCCollector(t *testing.T) *GrpcCollector

StartGRPCCollector starts GRPC collector on a random port

func (*GrpcCollector) Close added in v1.19.0

func (c *GrpcCollector) Close() error

Close closes the server

func (GrpcCollector) GetJaegerBatches added in v1.19.0

func (h GrpcCollector) GetJaegerBatches() []model.Batch

GetJaegerBatches returns accumulated Jaeger batches

func (*GrpcCollector) Listener added in v1.19.0

func (c *GrpcCollector) Listener() net.Listener

Listener returns server's listener

func (GrpcCollector) PostSpans added in v1.19.0

func (h GrpcCollector) PostSpans(_ context.Context, r *api_v2.PostSpansRequest) (*api_v2.PostSpansResponse, error)

type InMemoryReporter

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

InMemoryReporter collects spans in memory

func NewInMemoryReporter

func NewInMemoryReporter() *InMemoryReporter

NewInMemoryReporter creates new InMemoryReporter

func (*InMemoryReporter) EmitBatch

func (i *InMemoryReporter) EmitBatch(_ context.Context, batch *jaeger.Batch) (err error)

EmitBatch implements the corresponding method of the Reporter interface

func (*InMemoryReporter) EmitZipkinBatch

func (i *InMemoryReporter) EmitZipkinBatch(_ context.Context, spans []*zipkincore.Span) error

EmitZipkinBatch implements the corresponding method of the Reporter interface

func (*InMemoryReporter) Spans

func (i *InMemoryReporter) Spans() []*jaeger.Span

Spans returns accumulated spans as a copied slice

func (*InMemoryReporter) ZipkinSpans

func (i *InMemoryReporter) ZipkinSpans() []*zipkincore.Span

ZipkinSpans returns accumulated Zipkin spans as a copied slice

Jump to

Keyboard shortcuts

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