comparison

package
v1.24.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BuildConfig

type BuildConfig struct {
	// A label identifying the build.
	Label string `validate:"notempty"`

	// URL from where to download a build release.
	// This can also point to a local file if prefixed with "file://".
	// In such case, the build file will be uploaded to the app servers.
	URL string `validate:"url"`
}

BuildConfig holds information about a build.

type Comparison

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

Comparison holds the state needed to perform automated load-test comparisons.

func New

func New(cfg *Config, deployerCfg *deployment.Config) (*Comparison, error)

New creates and initializes a new Comparison object to be used to run automated load-test comparisons. It returns an error in case of failure.

func (*Comparison) Destroy

func (c *Comparison) Destroy() error

Destroy destroys all resources associated with the deployments for the current automated load-test comparisons.

func (*Comparison) GetDeploymentIds added in v1.10.0

func (c *Comparison) GetDeploymentIds() []string

func (*Comparison) Run

func (c *Comparison) Run() (Output, error)

Run performs fully automated load-test comparisons. It returns a list of results or an error in case of failure.

type Config

type Config struct {
	BaseBuild BuildConfig
	NewBuild  BuildConfig
	LoadTests []LoadTestConfig `validate:"notempty"`
	Output    OutputConfig
}

Config holds information needed perform automated load-test comparisons.

func ReadConfig

func ReadConfig(configFilePath string) (*Config, error)

ReadConfig reads the configuration file from the given string. If the string is empty, it will return a config with default values.

func (*Config) IsValid

func (c *Config) IsValid() error

type DatabaseEngine

type DatabaseEngine string
const (
	DBEngineMySQL DatabaseEngine = "mysql"
	DBEnginePgSQL DatabaseEngine = "postgresql"
)

type DeploymentInfo

type DeploymentInfo struct {
	// Number of application instances.
	AppInstanceCount int
	// Type of EC2 application instances.
	AppInstanceType string
	// Number of load-test agent instances.
	AgentInstanceCount int
	// Type of EC2 load-test agent instances.
	AgentInstanceType string
	// Type of EC2 proxy instance.
	ProxyInstanceType string
	// Number of RDS nodes.
	DBInstanceCount int
	// Type of RDS instance.
	DBInstanceType string
}

DeploymentInfo holds information regarding a deployment.

type LoadTestConfig

type LoadTestConfig struct {
	// The type of load-test to run.
	Type LoadTestType `validate:"oneof:{bounded,unbounded}"`
	// The database engine for the app server.
	DBEngine DatabaseEngine `validate:"oneof:{mysql,postgresql}"`
	// An optional URL to a MM server database dump file
	// to be loaded before running the load-test.
	// The file is expected to be gzip compressed.
	// This can also point to a local file if prefixed with "file://".
	// In such case, the dump file will be uploaded to the app servers.
	DBDumpURL string
	// An optional URI to an S3 bucket whose contents will be copied to
	// the deployed bucket before running the load-test.
	S3BucketDumpURI string `default:"" validate:"s3uri"`

	// The number of users to run.
	// This is only considered if Type is "bounded"
	NumUsers int `default:"0" validate:"range:[0,]"`
	// The duration of the load-test.
	// This is only considered if Type is "bounded"
	Duration string
}

LoadTestConfig holds information about a load-test to be automated.

func (*LoadTestConfig) IsValid

func (c *LoadTestConfig) IsValid() error

IsValid reports whether a given LoadTestConfig is valid or not. Returns an error if the validation fails.

type LoadTestResult

type LoadTestResult struct {
	Failed bool               // A flag indicating whether the load-test failed
	Label  string             // A label for the load-test.
	Config LoadTestConfig     // The config object associated with the load-test.
	Status coordinator.Status // The final status of the load-test.
	// contains filtered or unexported fields
}

LoadTestResult holds information regarding a load-test performed during a comparison.

type LoadTestType

type LoadTestType string
const (
	LoadTestTypeBounded   LoadTestType = "bounded"
	LoadTestTypeUnbounded LoadTestType = "unbounded"
)

type Output

type Output struct {
	// Information about the deployment in which the comparison ran.
	DeploymentInfo DeploymentInfo
	// A list of results.
	Results []Result
}

type OutputConfig

type OutputConfig struct {
	// A boolean indicating whether a comparative Grafana dashboard should
	// be generated and uploaded.
	UploadDashboard bool `default:"true"`
	// A boolean indicating whether to generate a markdown report
	// at the end of the comparison.
	GenerateReport bool `default:"true"`
	// A boolean indicating whether to generate gnuplot graphs
	// at the end of the comparison.
	GenerateGraphs bool `default:"false"`
	// An optional path indicating where to write the graphs.
	GraphsPath string
}

OutputConfig defines settings for the output of the comparison.

type Result

type Result struct {
	// An array of load-test results where the first element is the base run
	// and the second element is the new run.
	LoadTests [2]LoadTestResult
	// The Markdown report for the comparison.
	Report string
	// The URL to a comparative Grafana dashboard.
	DashboardURL string
	// contains filtered or unexported fields
}

Results holds information regarding the results of an automated load-test comparison.

Jump to

Keyboard shortcuts

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