trace

package
v0.0.0-...-feb402c Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MockTraceServer

type MockTraceServer struct {
	cloudtrace.UnimplementedTraceServiceServer
	mocktrace.UnimplementedMockTraceServiceServer
	// contains filtered or unexported fields
}

MockTraceServer implements all of the RPCs pertaining to tracing that can be called by the client.

func NewMockTraceServer

func NewMockTraceServer() *MockTraceServer

NewMockTraceServer creates a new MockTraceServer and returns a pointer to it.

func (*MockTraceServer) BatchWriteSpans

func (s *MockTraceServer) BatchWriteSpans(ctx context.Context, req *cloudtrace.BatchWriteSpansRequest) (*empty.Empty, error)

BatchWriteSpans creates and stores a list of spans on the server. If ANY of the spans in the request are invalid, ALL spans will be dropped.

func (*MockTraceServer) CreateSpan

func (s *MockTraceServer) CreateSpan(ctx context.Context, span *cloudtrace.Span) (*cloudtrace.Span, error)

CreateSpan validates a single span, and returns the Span proto.

func (*MockTraceServer) GetNumSpans

func (s *MockTraceServer) GetNumSpans() int

GetNumSpans returns the number of spans currently stored on the server. Used by the library implementation to avoid having to make a network call.

func (*MockTraceServer) GetSpan

func (s *MockTraceServer) GetSpan(index int) *cloudtrace.Span

GetSpan returns the span that was stored in memory at the given index. If the index is out of bounds, nil is returned.

func (*MockTraceServer) ListSpans

ListSpans returns a list of all the spans currently stored on the server.

func (*MockTraceServer) SetDelay

func (s *MockTraceServer) SetDelay(delay time.Duration)

SetDelay sets the amount of time to delay before writing the spans to memory.

func (*MockTraceServer) SetOnUpload

func (s *MockTraceServer) SetOnUpload(onUpload func(ctx context.Context, spans []*cloudtrace.Span))

SetOnUpload sets the onUpload function which is called before BatchWriteSpans runs.

func (*MockTraceServer) SpansSummary

func (s *MockTraceServer) SpansSummary() []*cloudtrace.Span

Jump to

Keyboard shortcuts

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