netsample

package
v0.5.2 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2023 License: MPL-2.0 Imports: 15 Imported by: 8

Documentation

Index

Constants

View Source
const (
	ProtoCodeError          = 999
	DiscardedShootCodeError = 777
	DiscardedShootTag       = "discarded"
)

Variables

This section is empty.

Functions

func WrapAggregator

func WrapAggregator(a Aggregator) core.Aggregator

Types

type Aggregator

type Aggregator interface {
	Run(ctx context.Context, deps core.AggregatorDeps) error
	Report(sample *Sample)
}

func NewPhout

func NewPhout(fs afero.Fs, conf PhoutConfig) (a Aggregator, err error)

func UnwrapAggregator

func UnwrapAggregator(a core.Aggregator) Aggregator

type PhoutConfig

type PhoutConfig struct {
	Destination     string                    // Destination file name
	ID              bool                      // Print ammo ids if true.
	FlushTime       time.Duration             `config:"flush-time"`
	SampleQueueSize int                       `config:"sample-queue-size"`
	Buffer          coreutil.BufferSizeConfig `config:",squash"`
}

func DefaultPhoutConfig

func DefaultPhoutConfig() PhoutConfig

type Sample

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

func Acquire

func Acquire(tag string) *Sample

func DiscardedShootSample added in v0.4.0

func DiscardedShootSample() *Sample

func (*Sample) AddTag

func (s *Sample) AddTag(tag string)

func (*Sample) Err

func (s *Sample) Err() error

func (*Sample) ID added in v0.3.3

func (s *Sample) ID() int

func (*Sample) ProtoCode

func (s *Sample) ProtoCode() int

func (*Sample) SetConnectTime added in v0.5.0

func (s *Sample) SetConnectTime(d time.Duration)

func (*Sample) SetErr

func (s *Sample) SetErr(err error)

func (*Sample) SetID added in v0.3.3

func (s *Sample) SetID(id int)

func (*Sample) SetLatency added in v0.3.2

func (s *Sample) SetLatency(d time.Duration)

func (*Sample) SetProtoCode

func (s *Sample) SetProtoCode(code int)

func (*Sample) SetReceiveTime added in v0.5.0

func (s *Sample) SetReceiveTime(d time.Duration)

func (*Sample) SetRequestBytes added in v0.3.2

func (s *Sample) SetRequestBytes(b int)

func (*Sample) SetResponseBytes added in v0.5.0

func (s *Sample) SetResponseBytes(b int)

func (*Sample) SetSendTime added in v0.5.0

func (s *Sample) SetSendTime(d time.Duration)

func (*Sample) SetUserDuration added in v0.3.2

func (s *Sample) SetUserDuration(d time.Duration)

func (*Sample) SetUserNet added in v0.3.2

func (s *Sample) SetUserNet(code int)

func (*Sample) SetUserProto added in v0.3.2

func (s *Sample) SetUserProto(code int)

func (*Sample) String

func (s *Sample) String() string

func (*Sample) Tags

func (s *Sample) Tags() string

type TestAggregator

type TestAggregator struct {
	Samples []*Sample
}

func (*TestAggregator) Report

func (t *TestAggregator) Report(s *Sample)

func (*TestAggregator) Run

Jump to

Keyboard shortcuts

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