replay

package
v0.0.0-...-e87eaec Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package replay is a component to run the dogstatsd capture/replay

Index

Constants

View Source
const (
	// GUID will be used as the GUID during capture replays
	// This is a magic number chosen for no particular reason other than the fact its
	// quite large an improbable to match an actual Group ID on any given box. We
	// need this number to identify replayed Unix socket ancillary credentials.
	GUID = 999888777
)

Variables

This section is empty.

Functions

This section is empty.

Types

type CaptureBuffer

type CaptureBuffer struct {
	Pb          UnixDogstatsdMsg
	Oob         *[]byte
	Pid         int32
	ContainerID string
	Buff        *packets.Packet
}

CaptureBuffer holds pointers to captured packet's buffers (and oob buffer if required) and the protobuf message used for serialization.

type Component

type Component interface {

	// IsOngoing returns whether a capture is ongoing for this TrafficCapture instance.
	IsOngoing() bool

	// StartCapture starts a TrafficCapture and returns an error in the event of an issue.
	StartCapture(p string, d time.Duration, compressed bool) (string, error)

	// StopCapture stops an ongoing TrafficCapture.
	StopCapture()

	// TODO: (components) pool manager should be injected as a component in the future.
	// RegisterSharedPoolManager registers the shared pool manager with the TrafficCapture.
	RegisterSharedPoolManager(p *packets.PoolManager[packets.Packet]) error

	// TODO: (components) pool manager should be injected as a component in the future.
	// RegisterOOBPoolManager registers the OOB shared pool manager with the TrafficCapture.f
	RegisterOOBPoolManager(p *packets.PoolManager[[]byte]) error

	// Enqueue enqueues a capture buffer so it's written to file.
	Enqueue(msg *CaptureBuffer) bool

	// GetStartUpError returns an error if TrafficCapture failed to start up
	GetStartUpError() error
}

Component is the component type.

type UnixDogstatsdMsg

type UnixDogstatsdMsg struct {
	Timestamp     int64
	PayloadSize   int32
	Payload       []byte
	Pid           int32
	AncillarySize int32
	Ancillary     []byte
}

UnixDogstatsdMsg mirrors the exported fields of pkg/proto/pbgo/core/model.pb.go 'UnixDogstatsdMsg to avoid forcing the import of pbgo on every user of dogstatsd.

Jump to

Keyboard shortcuts

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