test

package
v0.0.0-...-bf0a8c2 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2025 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default cpu usage threshold in milliCpus.
	PtpDefaultMilliCoresUsageThreshold = 15
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ContainerName

type ContainerName string

func (*ContainerName) String

func (n *ContainerName) String() string

type CpuTestSpec

type CpuTestSpec struct {
	TestSpec
	CustomParams CpuUsageCustomParams `yaml:"custom_params"`
}

func (*CpuTestSpec) UnmarshalYAML

func (t *CpuTestSpec) UnmarshalYAML(unmarshal func(interface{}) error) error

type CpuUsageCustomParams

type CpuUsageCustomParams struct {
	PromTimeWindow string              `yaml:"prometheus_rate_time_window"`
	Node           *CpuUsageNodeConfig `yaml:"node,omitempty"`
	Pod            *CpuUsagePodConfigs `yaml:"pod,omitempty"`
}

type CpuUsageNodeConfig

type CpuUsageNodeConfig struct {
	CpuUsageThreshold int `yaml:"cpu_threshold_mcores"`
}

func (*CpuUsageNodeConfig) String

func (cfg *CpuUsageNodeConfig) String() string

type CpuUsagePodConfig

type CpuUsagePodConfig struct {
	PodType           string         `yaml:"pod_type"`
	Container         *ContainerName `yaml:"container,omitempty"`
	CpuUsageThreshold int            `yaml:"cpu_threshold_mcores"`
}

type CpuUsagePodConfigs

type CpuUsagePodConfigs []CpuUsagePodConfig

func (*CpuUsagePodConfigs) String

func (p *CpuUsagePodConfigs) String() string

type CpuUtilization

type CpuUtilization struct {
	CpuTestSpec CpuTestSpec `yaml:"spec"`
	Description string      `yaml:"desc"`
}

func (*CpuUtilization) PromRateTimeWindow

func (config *CpuUtilization) PromRateTimeWindow() (time.Duration, error)

func (*CpuUtilization) ShouldCheckContainerCpuUsage

func (config *CpuUtilization) ShouldCheckContainerCpuUsage(podName, containerName string) (bool, float64)

func (*CpuUtilization) ShouldCheckNodeTotalCpuUsage

func (config *CpuUtilization) ShouldCheckNodeTotalCpuUsage() (bool, float64)

func (*CpuUtilization) ShouldCheckPodCpuUsage

func (config *CpuUtilization) ShouldCheckPodCpuUsage(podName string) (bool, float64)

type GlobalConfig

type GlobalConfig struct {
	MinOffset int `yaml:"minoffset"`
	MaxOffset int `yaml:"maxoffset"`
}

type PtpTestConfig

type PtpTestConfig struct {
	GlobalConfig   GlobalConfig   `yaml:"global"`
	SoakTestConfig SoakTestConfig `yaml:"soaktest"`
}

func GetPtpTestConfig

func GetPtpTestConfig() (*PtpTestConfig, error)

type SlaveClockSync

type SlaveClockSync struct {
	TestSpec    TestSpec `yaml:"spec"`
	Description string   `yaml:"desc"`
}

type SoakTestConfig

type SoakTestConfig struct {
	DisableSoakTest      bool           `yaml:"disable_all"`
	FailureThreshold     int            `default:"1"`
	Duration             int64          `yaml:"duration"`
	EventOutputFile      string         `yaml:"event_output_file" default:"./event-output.csv"`
	SlaveClockSyncConfig SlaveClockSync `yaml:"slave_clock_sync"`
	CpuUtilization       CpuUtilization `yaml:"cpu_utilization"`
}

func (*SoakTestConfig) UnmarshalYAML

func (t *SoakTestConfig) UnmarshalYAML(unmarshal func(interface{}) error) error

type TestSpec

type TestSpec struct {
	Enable           bool  `default:"true"`
	FailureThreshold int   `yaml:"failure_threshold"`
	Duration         int64 `yaml:"duration"`
}

func (*TestSpec) UnmarshalYAML

func (t *TestSpec) UnmarshalYAML(unmarshal func(interface{}) error) error

Jump to

Keyboard shortcuts

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