core

package
v0.0.0-...-c8bf5b5 Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2023 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ExampleAttributeNames = []string{}/* 148 elements not displayed */

Functions

func BenchmarkLocalDelivery

func BenchmarkLocalDelivery(
	clientFactory func() Client,
	serverFactory func() Server,
	generatorFactory func() SpanGenerator,
	options Options,
) (cpuSecs float64, wallSecs float64)

func GenRandAttrName

func GenRandAttrName(random *rand.Rand) string

func GenerateSpanID

func GenerateSpanID(id uint64) []byte

func GenerateTraceID

func GenerateTraceID(id uint64) []byte

func GenerateTraceIDHigh

func GenerateTraceIDHigh(id uint64) uint64

func GenerateTraceIDLow

func GenerateTraceIDLow(id uint64) uint64

func GetAvailableLocalAddress

func GetAvailableLocalAddress() string

GetAvailableLocalAddress finds an available local port and returns an endpoint describing it. The port is available for opening when this function returns provided that there is no race by some other code to grab the same port immediately.

func LoadGenerator

func LoadGenerator(
	clientFactory func() Client,
	generatorFactory func() SpanGenerator,
	serverEndpoint string,
	spansPerSecond int,
)

func RunAgent

func RunAgent(clnt Client, srv Server, listenAddress, destination string)

func RunServer

func RunServer(srv Server, listenAddress string, onReceive func(spanCount int))

func RunTest

func RunTest(clnt Client, srv Server, gen SpanGenerator)

func TimeToTimestamp

func TimeToTimestamp(t time.Time) uint64

Types

type Client

type Client interface {
	Connect(server string) error
	Export(batch ExportRequest)
	Shutdown()
}

Client can connect to a server and send a batch of spans.

type Encoding

type Encoding interface {
}

type ExportRequest

type ExportRequest interface {
}

ExportRequest represents a telemetry data export request.

type Generator

type Generator interface {
	SpanGenerator
	MetricGenerator
	LogGenerator
}

type LogGenerator

type LogGenerator interface {
	GenerateLogBatch(logsPerBatch int, attrsPerLog int) ExportRequest
}

LogGenerator allows to generate a ExportRequest containing a batch of log.

type MetricGenerator

type MetricGenerator interface {
	GenerateMetricBatch(
		metricsPerBatch int,
		valuesPerTimeseries int,
		int64 bool,
		histogram bool,
		summary bool,
	) ExportRequest
}

MetricGenerator allows to generate a ExportRequest containing a batch of metrics.

type MetricTranslator

type MetricTranslator interface {
	FromOTLPMetrics(batch *otlpmetriccol.ExportMetricsServiceRequest) ExportRequest
}

type Options

type Options struct {
	Batches       int
	SpansPerBatch int
	AttrPerSpan   int
}

type Server

type Server interface {
	Listen(endpoint string, onReceive func(batch ExportRequest, spanCount int)) error
	Stop()
}

Server allows to listen on a port and receive Batches of spans.

type SpanGenerator

type SpanGenerator interface {
	GenerateSpanBatch(spansPerBatch int, attrsPerSpan int, timedEventsPerSpan int) ExportRequest
}

SpanGenerator allows to generate a ExportRequest containing a batch of spans.

type SpanTranslator

type SpanTranslator interface {
	FromOTLPSpans(batch *otlptracecol.ExportTraceServiceRequest) ExportRequest
}

Jump to

Keyboard shortcuts

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