clients

package
v0.0.0-...-4785ff0 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2018 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrAWSError = "Unable to run ec2"
)

Variables

This section is empty.

Functions

func IsAWSDeploymentError

func IsAWSDeploymentError(error string) bool

func UrlBasePath

func UrlBasePath(u *url.URL) string

Types

type AnalyzerClient

type AnalyzerClient struct {
	Url *url.URL
}

func NewAnalyzerClient

func NewAnalyzerClient(config *viper.Viper) (*AnalyzerClient, error)

func (*AnalyzerClient) GetNextInstanceTypes

func (client *AnalyzerClient) GetNextInstanceTypes(
	runId string,
	appName string,
	results map[string]float64,
	logger *logging.Logger) ([]string, error)

GetNextInstanceTypes asks the analyzer if we should run more benchmark runs on different vm instance types or not. If the return array is empty, then the analyzer has found the optimal choice.

type BenchmarkAgentClient

type BenchmarkAgentClient struct{}

func NewBenchmarkAgentClient

func NewBenchmarkAgentClient() *BenchmarkAgentClient

func (*BenchmarkAgentClient) CreateBenchmark

func (client *BenchmarkAgentClient) CreateBenchmark(
	baseUrl string,
	benchmark *models.Benchmark,
	config *models.BenchmarkConfig,
	intensity int,
	logger *logging.Logger) error

func (*BenchmarkAgentClient) DeleteBenchmark

func (client *BenchmarkAgentClient) DeleteBenchmark(baseUrl string, benchmarkName string, logger *logging.Logger) error

type BenchmarkAgentResponse

type BenchmarkAgentResponse struct {
	Status string `json:"status"`
	Data   string `json:"data"`
	Error  bool   `json:"error"`
}

type BenchmarkControllerBenchmarkResponse

type BenchmarkControllerBenchmarkResponse struct {
	Status  string `json:"status"`
	Error   string `json:"error"`
	Results []struct {
		Results   map[string]interface{} `json:"results"`
		Intensity int                    `json"intensity"`
	} `json:"results"`
}

type BenchmarkControllerCalibrationResponse

type BenchmarkControllerCalibrationResponse struct {
	Status  string `json:"status"`
	Error   string `json:"error"`
	Results struct {
		RunResults []struct {
			Results       map[string]interface{} `json:"results"`
			IntensityArgs map[string]interface{} `json:"intensityArgs"`
		} `json:"runResults"`
		FinalResults struct {
			IntensityArgs map[string]interface{} `json:"intensityArgs"`
			Qos           float64                `json:"qos"`
		} `json:"finalResults"`
	} `json:"results"`
}

type BenchmarkControllerClient

type BenchmarkControllerClient struct{}

func (*BenchmarkControllerClient) RunBenchmark

func (client *BenchmarkControllerClient) RunBenchmark(
	loadTesterName string,
	baseUrl string,
	stageId string,
	intensity float64,
	controller *models.BenchmarkController,
	logger *logging.Logger) (*BenchmarkControllerBenchmarkResponse, error)

func (*BenchmarkControllerClient) RunCalibration

func (client *BenchmarkControllerClient) RunCalibration(
	loadTesterName string,
	baseUrl string,
	stageId string,
	controller *models.BenchmarkController,
	slo models.SLO,
	logger *logging.Logger) (*BenchmarkControllerCalibrationResponse, error)

type DeployerClient

type DeployerClient struct {
	Cache map[string]*DeploymentCache

	Url *url.URL
}

func NewDeployerClient

func NewDeployerClient(config *viper.Viper) (*DeployerClient, error)

func (*DeployerClient) CreateDeployment

func (client *DeployerClient) CreateDeployment(
	deployment *deployer.Deployment,
	loadTesterName string,
	log *logging.Logger) (string, error)

func (*DeployerClient) CreateDeploymentWithTemplate

func (client *DeployerClient) CreateDeploymentWithTemplate(
	deploymentTemplate string,
	deployment *deployer.Deployment,
	loadTesterName string,
	log *logging.Logger) (string, error)

func (*DeployerClient) DeleteDeployment

func (client *DeployerClient) DeleteDeployment(deploymentId string, log *logging.Logger) error

func (*DeployerClient) DeployExtensions

func (client *DeployerClient) DeployExtensions(
	deploymentTemplate string,
	deploymentId string,
	deployment *deployer.Deployment,
	loadTesterName string,
	log *logging.Logger) error

func (*DeployerClient) GetColocatedServiceUrls

func (client *DeployerClient) GetColocatedServiceUrls(
	deployment string,
	colocatedServicePrefix string,
	targetServicePrefix string,
	log *logging.Logger) ([]string, error)

GetColocatedServiceUrls finds the service's urls that's running on the same nodes where colocatedService is running. We don't specify exact service names because services that has multiple copies will be named differently but sharing the same prefix (e.g: benchmark-agent, benchmark-agent-2, etc.).

func (*DeployerClient) GetServiceAddress

func (client *DeployerClient) GetServiceAddress(deployment string, service string, log *logging.Logger) (*ServiceAddress, error)

GetServiceAddress return the address object of service container

func (*DeployerClient) GetServiceUrl

func (client *DeployerClient) GetServiceUrl(deployment string, service string, log *logging.Logger) (string, error)

func (*DeployerClient) GetServiceUrls

func (client *DeployerClient) GetServiceUrls(deployment string, servicePrefix string, log *logging.Logger) ([]string, error)

func (*DeployerClient) GetSupportedAWSInstances

func (client *DeployerClient) GetSupportedAWSInstances(region string, availabilityZone string) ([]string, error)

func (*DeployerClient) IsDeploymentReady

func (client *DeployerClient) IsDeploymentReady(deployment string) (bool, error)

func (*DeployerClient) ResetTemplateDeployment

func (client *DeployerClient) ResetTemplateDeployment(
	deploymentTemplate string,
	deploymentId string,
	log *logging.Logger) error

type DeployerResponse

type DeployerResponse struct {
	Error bool   `json:"error"`
	Data  string `json:"data`
}

type DeploymentCache

type DeploymentCache struct {
	ServiceMapping   *ServiceMappingResponse
	ServiceUrls      map[string]string
	ServiceAddresses map[string]*ServiceAddress
}

type DeploymentStateResponse

type DeploymentStateResponse struct {
	State string `json:"state"`
	Data  string `json:"data"`
}

type GetNextInstanceTypesRequest

type GetNextInstanceTypesRequest struct {
	AppName string           `json:"appName"`
	Data    []InstanceResult `json:"data"`
}

type GetNextInstanceTypesResponse

type GetNextInstanceTypesResponse struct {
	Status        string   `json:"status"`
	InstanceTypes []string `json:"data"`
	Error         string   `json:"error"`
}

type GetSupportedAWSInstancesResponse

type GetSupportedAWSInstancesResponse struct {
	Instances []string `json:"instances"`
	Error     bool     `json:"error"`
	Data      string   `json:"data"`
}

type InfluxClient

type InfluxClient struct {
	ScriptPath string
	Url        string
	Port       int
	BackupPort int
}

func NewInfluxClient

func NewInfluxClient(scriptPath string, url string, port int, backupPort int) (*InfluxClient, error)

func (*InfluxClient) BackupDB

func (client *InfluxClient) BackupDB(key string, logger *logging.Logger) error

type InstanceResult

type InstanceResult struct {
	InstanceType string  `json:"instanceType"`
	QosValue     float64 `json:"qosValue"`
}

type ServiceAddress

type ServiceAddress struct {
	Host string `bson:"host,omitempty" json:"host,omitempty"`
	Port int64  `bson:"port,omitempty" json:"port,omitempty"`
}

ServiceAddress GetServiceUrl return this object

type ServiceMapping

type ServiceMapping struct {
	NodeId    int    `json:"nodeId"`
	NodeName  string `json:"nodeName"`
	PublicUrl string `json:"publicUrl"`
}

type ServiceMappingResponse

type ServiceMappingResponse struct {
	Data  map[string]ServiceMapping
	Error bool
}

type SlowCookerBenchmarkRequest

type SlowCookerBenchmarkRequest struct {
	LoadTime         string                    `json:"loadTime"`
	RunsPerIntensity int                       `json:"runsPerIntensity"`
	AppLoad          *models.SlowCookerAppLoad `json:"appLoad"`
}

func (SlowCookerBenchmarkRequest) PrintVerbose

func (request SlowCookerBenchmarkRequest) PrintVerbose(logger *logging.Logger)

type SlowCookerBenchmarkResponse

type SlowCookerBenchmarkResponse struct {
	Id      string                      `json:"id"`
	Error   string                      `json:"error"`
	State   string                      `json:"state"`
	Results []SlowCookerBenchmarkResult `json:"results"`
}

type SlowCookerBenchmarkResult

type SlowCookerBenchmarkResult struct {
	Failures      uint64 `json:"failures"`
	PercentileMin int64  `json:"percentileMin"`
	Percentile50  int64  `json:"percentile50"`
	Percentile95  int64  `json:"percentile95"`
	Percentile99  int64  `json:"percentile99"`
	PercentileMax int64  `json:"percentileMax"`
}

type SlowCookerCalibrateRequest

type SlowCookerCalibrateRequest struct {
	Calibrate *models.SlowCookerCalibrate `json:"calibrate"`
	SLO       *SlowCookerSLO              `json:"slo"`
	AppLoad   *models.SlowCookerAppLoad   `json:"appLoad"`
	LoadTime  string                      `json:"loadTime"`
}

func (SlowCookerCalibrateRequest) PrintVerbose

func (request SlowCookerCalibrateRequest) PrintVerbose(logger *logging.Logger)

type SlowCookerCalibrateResponse

type SlowCookerCalibrateResponse struct {
	Id               string                       `json:"id"`
	Results          []*SlowCookerCalibrateResult `json:"results"`
	FinalResult      *SlowCookerCalibrateResult   `json:"finalResult"`
	FinalConcurrency int                          `json:"finalConcurrency"`
	Error            string                       `json:"error"`
	State            string                       `json:"state"`
}

type SlowCookerCalibrateResult

type SlowCookerCalibrateResult struct {
	Concurrency int    `json:"concurrency"`
	LatencyMs   int64  `json:"latencyMs"`
	Failures    uint64 `json:"failures"`
}

type SlowCookerClient

type SlowCookerClient struct{}

func (*SlowCookerClient) RunBenchmark

func (client *SlowCookerClient) RunBenchmark(
	baseUrl string,
	runId string,
	appIntensity float64,
	runsPerIntensity int,
	controller *models.SlowCookerController,
	logger *logging.Logger,
	waitResults bool) (*SlowCookerBenchmarkResponse, error)

func (*SlowCookerClient) RunCalibration

func (client *SlowCookerClient) RunCalibration(
	baseUrl string,
	runId string,
	slo models.SLO,
	controller *models.SlowCookerController,
	logger *logging.Logger) (*SlowCookerCalibrateResponse, error)

type SlowCookerSLO

type SlowCookerSLO struct {
	LatencyMs  int `json:"latencyMs"`
	Percentile int `json:"percentile"`
}

Jump to

Keyboard shortcuts

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