maps

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountEntries added in v0.0.2

func CountEntries(id ebpf.MapID) (int, error)

func FormatBytes added in v0.0.2

func FormatBytes(format DisplayFormat, value []byte) string

func IsLookupSupported added in v0.0.2

func IsLookupSupported(mt ebpf.MapType) bool

func IsPerCPU added in v0.0.2

func IsPerCPU(mt ebpf.MapType) bool

func RestoreBytes added in v0.0.4

func RestoreBytes(format DisplayFormat, value string, expectedSize uint32) ([]byte, error)

Types

type DisplayFormat added in v0.0.2

type DisplayFormat = string
const (
	DisplayFormatHex    DisplayFormat = "hex"
	DisplayFormatString DisplayFormat = "string"
	DisplayFormatNumber DisplayFormat = "number"
)

type MapEntries added in v0.0.2

type MapEntries struct {
	Entries []*MapEntry
}

func GetEntries added in v0.0.2

func GetEntries(id ebpf.MapID, sort bool) (*MapEntries, error)

type MapEntry added in v0.0.2

type MapEntry struct {
	Key       []byte
	CPUValues [][]byte
	Value     []byte
}

type MapExportConfiguration added in v0.0.2

type MapExportConfiguration struct {
	StartID          int
	EndID            int
	MetricNameRegexp regexp.Regexp
	KeyFormat        DisplayFormat
}

func ParseMapExportConfiguration added in v0.0.2

func ParseMapExportConfiguration(config string) (*MapExportConfiguration, error)

func (*MapExportConfiguration) MatchMap added in v0.0.2

func (c *MapExportConfiguration) MatchMap(id ebpf.MapID, name string) bool

type MapInfo

type MapInfo struct {
	ID         ebpf.MapID
	Error      error
	Name       string
	Type       ebpf.MapType
	Flags      uint32
	Pins       []string
	KeySize    uint32
	ValueSize  uint32
	MaxEntries uint32
}

type MapsWatcher

type MapsWatcher interface {
	Run(ctx context.Context, refreshInterval time.Duration)
	GetMaps() ([]*MapInfo, error)
	GetMap(id ebpf.MapID) (*MapInfo, error)
	RegisterMetrics(registry *prometheus.Registry)
	AddExportConfig(config *MapExportConfiguration)
	PinMap(id ebpf.MapID, path string) error
	UpdateMapValue(id ebpf.MapID, key string, cpu *int, value string, keyFormat DisplayFormat, mapsFormat DisplayFormat) error
	CreateMapValue(id ebpf.MapID, key string, values []string, keyFormat DisplayFormat, mapsFormat DisplayFormat) error
	DeleteMapValue(id ebpf.MapID, key string, keyFormat DisplayFormat) error
}

func NewWatcher

func NewWatcher(logger zerolog.Logger, bpfDir string) MapsWatcher

type WatcherOpts added in v0.0.2

type WatcherOpts struct {
	RefreshInterval time.Duration
}

Jump to

Keyboard shortcuts

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