agent

package
v1.300034.1 Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AllowAllOperations = "*"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Flag added in v1.300034.0

type Flag int
const (
	FlagIMDSFallbackSuccess Flag = iota
	FlagSharedConfigFallback
	FlagAppSignal
	FlagEnhancedContainerInsights
	FlagRunningInContainer
	FlagMode
	FlagRegionType
)

func (Flag) MarshalText added in v1.300034.0

func (f Flag) MarshalText() (text []byte, err error)

func (Flag) String added in v1.300034.0

func (f Flag) String() string

func (*Flag) UnmarshalText added in v1.300034.0

func (f *Flag) UnmarshalText(text []byte) error

type FlagSet added in v1.300034.0

type FlagSet interface {
	// IsSet returns if the flag is present in the backing map.
	IsSet(flag Flag) bool
	// GetString if the value stored with the flag is a string. If not, returns nil.
	GetString(flag Flag) *string
	// Set adds the Flag with an unused value.
	Set(flag Flag)
	// SetValue adds the Flag with a value.
	SetValue(flag Flag, value any)
	// SetValues adds each Flag/value pair.
	SetValues(flags map[Flag]any)
	// OnChange registers a callback that triggers on flag sets.
	OnChange(callback func())
}

FlagSet is a getter/setter for flag/value pairs. Once a flag key is set, its value is immutable.

func UsageFlags added in v1.300034.0

func UsageFlags() FlagSet

type OperationsFilter

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

func NewOperationsFilter

func NewOperationsFilter(operations ...string) OperationsFilter

func (OperationsFilter) IsAllowed

func (of OperationsFilter) IsAllowed(operationName string) bool

type Stats

type Stats struct {
	CpuPercent                *float64 `json:"cpu,omitempty"`
	MemoryBytes               *uint64  `json:"mem,omitempty"`
	FileDescriptorCount       *int32   `json:"fd,omitempty"`
	ThreadCount               *int32   `json:"th,omitempty"`
	LatencyMillis             *int64   `json:"lat,omitempty"`
	PayloadBytes              *int     `json:"load,omitempty"`
	StatusCode                *int     `json:"code,omitempty"`
	SharedConfigFallback      *int     `json:"scfb,omitempty"`
	ImdsFallbackSucceed       *int     `json:"ifs,omitempty"`
	AppSignals                *int     `json:"as,omitempty"`
	EnhancedContainerInsights *int     `json:"eci,omitempty"`
	RunningInContainer        *int     `json:"ric,omitempty"`
	RegionType                *string  `json:"rt,omitempty"`
	Mode                      *string  `json:"m,omitempty"`
}

func (*Stats) Marshal

func (s *Stats) Marshal() (string, error)

func (*Stats) Merge

func (s *Stats) Merge(other Stats)

Merge the other Stats into the current. If the field is not nil, then it'll overwrite the existing one.

type StatsConfig

type StatsConfig struct {
	// Operations are the allowed operation names to gather stats for.
	Operations []string `mapstructure:"operations,omitempty"`
	// UsageFlags are the usage flags to set on start up.
	UsageFlags map[Flag]any `mapstructure:"usage_flags,omitempty"`
}

type StatsProvider

type StatsProvider interface {
	Stats(operation string) Stats
}

Jump to

Keyboard shortcuts

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