testm3server

package
v2.0.18 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FakeM3Server

type FakeM3Server struct {
	Service *FakeM3Service
	Addr    string
	// contains filtered or unexported fields
}

FakeM3Server represents an M3 UDP server

func NewFakeM3Server

func NewFakeM3Server(
	t *testing.T,
	wg *lib.WaitAtLeast,
	countBatches bool,
	countMetrics bool,
	protocol metrics.Protocol,
) *FakeM3Server

NewFakeM3Server creates server, pass it a wait group Which can be used to wait for receival of messages

func (*FakeM3Server) Close

func (f *FakeM3Server) Close() error

Close closes the UDP server

func (*FakeM3Server) Serve

func (f *FakeM3Server) Serve()

Serve will handle incoming UDP connections, currently only reads one packet

type FakeM3Service

type FakeM3Service struct {
	MaxMetrics int
	// contains filtered or unexported fields
}

FakeM3Service tracks the metrics the server has received

func NewFakeM3Service

func NewFakeM3Service(
	wg *lib.WaitAtLeast,
	countBatches bool,
	countMetrics bool,
) *FakeM3Service

NewFakeM3Service creates an M3Service

func (*FakeM3Service) EmitMetricBatchV2

func (m *FakeM3Service) EmitMetricBatchV2(batch m3.MetricBatch) (err error)

EmitMetricBatchV2 is called by thrift message processor

func (*FakeM3Service) GetBatches

func (m *FakeM3Service) GetBatches() []m3.MetricBatch

GetBatches gets the batches

func (*FakeM3Service) GetMetrics

func (m *FakeM3Service) GetMetrics() map[string]m3.Metric

GetMetrics gets the individual metrics

Jump to

Keyboard shortcuts

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