common

package
v0.0.0-...-6b10bcf Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ENV_SKUPPER_SITES              = "SKUPPER_SITES"
	ENV_SKUPPER_MAX_FRAME_SIZE     = "SKUPPER_MAX_FRAME_SIZE"
	ENV_SKUPPER_MAX_SESSION_FRAMES = "SKUPPER_MAX_SESSION_FRAMES"
	ENV_SKUPPER_MEMORY             = "SKUPPER_MEMORY"
	ENV_SKUPPER_CPU                = "SKUPPER_CPU"
	ENV_SKUPPER_PERF_TIMEOUT       = "SKUPPER_PERF_TIMEOUT"
	TestPath                       = "./tmp"
)

Variables

View Source
var (
	OutputPath = TestPath
)

Functions

func DebugMode

func DebugMode() bool

func RunPerformanceTest

func RunPerformanceTest(perfTest PerformanceTest) error

func RunPerformanceTests

func RunPerformanceTests(m *testing.M, debugMode bool)

Types

type AdaptorType

type AdaptorType string
const AdaptorHTTP AdaptorType = "http"
const AdaptorTCP AdaptorType = "tcp"

type AppSettings

type AppSettings map[string]string

func (AppSettings) AddEnvVar

func (a AppSettings) AddEnvVar(name string, dflt string) string

type ClientInfo

type ClientInfo struct {
	Name      string           `json:"name"`
	Resources ResourceSettings `json:"resources,omitempty"`
	Settings  AppSettings      `json:"settings,omitempty"`
	Timeout   time.Duration    `json:"timeout,omitempty"`
	Jobs      []JobInfo        `json:"jobs"`
}

func (*ClientInfo) JobNames

func (c *ClientInfo) JobNames() []string

type JobInfo

type JobInfo struct {
	Name    string       `json:"name"`
	Clients int          `json:"clients"`
	Job     *batchv1.Job `json:"job"`
}

type LatencyUnitType

type LatencyUnitType string
const LatencyUnitMs LatencyUnitType = "ms"

type PerformanceApp

type PerformanceApp struct {
	Name             string             `json:"name"`
	Description      string             `json:"description,omitempty"`
	Service          ServiceInfo        `json:"service"`
	Server           *ServerInfo        `json:"server"`
	Client           *ClientInfo        `json:"client"`
	ThroughputUnit   ThroughputUnitType `json:"throughputUnit,omitempty"`
	LatencyUnit      LatencyUnitType    `json:"latencyUnit,omitempty"`
	TlsCredentials   string             `json:"tlsCredentials"`
	TlsCertAuthority string             `json:"tlsCertAuthority"`
}

type PerformanceTest

type PerformanceTest interface {
	App() PerformanceApp
	Validate(serverCluster, clientCluster *base.ClusterContext, job JobInfo) Result
}

type ResourceSettings

type ResourceSettings struct {
	Memory string `json:"memory,omitempty"`
	CPU    string `json:"CPU,omitempty"`
}

type Result

type Result struct {
	App        PerformanceApp  `json:"app"`
	Sites      int             `json:"sites"`
	Skupper    SkupperSettings `json:"skupper"`
	Failed     bool            `json:"failed,omitempty"`
	Error      error           `json:"error,omitempty"`
	Job        JobInfo         `json:"job"`
	Throughput float64         `json:"throughput,omitempty"`
	LatencyAvg float64         `json:"latencyAvg,omitempty"`
	Latency50  float64         `json:"latency50,omitempty"`
	Latency99  float64         `json:"latency99,omitempty"`
}

func (*Result) SetError

func (r *Result) SetError(err error)

type RouterSettings

type RouterSettings struct {
	MaxFrameSize     int              `json:"maxFrameSize,omitempty"`
	MaxSessionFrames int              `json:"maxSessionFrames,omitempty"`
	Resources        ResourceSettings `json:"resources,omitempty"`
}

type ServerInfo

type ServerInfo struct {
	Name             string             `json:"name"`
	Resources        ResourceSettings   `json:"resources,omitempty"`
	Settings         AppSettings        `json:"settings,omitempty"`
	Deployment       *appsv1.Deployment `json:"deployment"`
	PostInitCommands [][]string         `json:"postInitCommands"`
}

type ServiceInfo

type ServiceInfo struct {
	Address  string      `json:"address"`
	Protocol string      `json:"protocol"`
	Adaptor  AdaptorType `json:"adaptor"`
	Port     int         `json:"port"`
}

type SkupperSettings

type SkupperSettings struct {
	Sites   []int          `json:"sites"`
	Timeout string         `json:"timeout,omitempty"`
	Router  RouterSettings `json:"router,omitempty"`
}

type ThroughputUnitType

type ThroughputUnitType string
const ThroughputUnitGbps ThroughputUnitType = "gbits/s"
const ThroughputUnitMsgs ThroughputUnitType = "msg/s"
const ThroughputUnitReqs ThroughputUnitType = "req/s"
const ThroughputUnitTps ThroughputUnitType = "tps"

Jump to

Keyboard shortcuts

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