testm3server

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2023 License: MIT Imports: 13 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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 added in v0.6.7

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