proftest

package
v0.34.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2018 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 ClusterConfig

type ClusterConfig struct {
	ProjectID       string
	Zone            string
	ClusterName     string
	PodName         string
	ImageSourceName string
	ImageName       string
	Bucket          string
	Dockerfile      string
}

ClusterConfig is configuration for starting single GKE cluster for profiling agent test case.

type GCETestRunner

type GCETestRunner struct {
	TestRunner
	ComputeService *compute.Service
}

GCETestRunner supports testing a profiling agent on GCE.

func (*GCETestRunner) DeleteInstance

func (tr *GCETestRunner) DeleteInstance(ctx context.Context, inst *InstanceConfig) error

DeleteInstance deletes an instance with project id, name, and zone matched by inst.

func (*GCETestRunner) PollForSerialOutput

func (tr *GCETestRunner) PollForSerialOutput(ctx context.Context, inst *InstanceConfig, finishString, errorString string) error

PollForSerialOutput polls serial port 2 of the GCE instance specified by inst and returns when the finishString appears in the serial output of the instance, or when the context times out.

func (*GCETestRunner) StartInstance

func (tr *GCETestRunner) StartInstance(ctx context.Context, inst *InstanceConfig) error

StartInstance starts a GCE Instance with name, zone, and projectId specified by the inst, and which runs the startup script specified in inst.

type GKETestRunner

type GKETestRunner struct {
	TestRunner
	ContainerService *container.Service
	StorageClient    *storage.Client
	Dockerfile       string
}

GKETestRunner supports testing a profiling agent on GKE.

func (*GKETestRunner) DeleteClusterAndImage

func (tr *GKETestRunner) DeleteClusterAndImage(ctx context.Context, cfg *ClusterConfig) []error

DeleteClusterAndImage deletes cluster and images used to create cluster.

func (*GKETestRunner) PollPodLog

func (tr *GKETestRunner) PollPodLog(ctx context.Context, kubernetesClient *kubernetes.Client, podName, finishString string) error

PollPodLog polls the log of the kubernetes client and returns when the finishString appears in the log, or when the context times out.

func (*GKETestRunner) StartAndDeployCluster

func (tr *GKETestRunner) StartAndDeployCluster(ctx context.Context, cfg *ClusterConfig) error

StartAndDeployCluster creates image needed for cluster, then starts and deploys to cluster.

type InstanceConfig

type InstanceConfig struct {
	ProjectID     string
	Zone          string
	Name          string
	StartupScript string
	MachineType   string
}

InstanceConfig is configuration for starting single GCE instance for profiling agent test case.

type ProfileData

type ProfileData struct {
	Samples           []int32       `json:"samples"`
	SampleMetrics     interface{}   `json:"sampleMetrics"`
	DefaultMetricType string        `json:"defaultMetricType"`
	TreeNodes         interface{}   `json:"treeNodes"`
	Functions         functionArray `json:"functions"`
	SourceFiles       interface{}   `json:"sourceFiles"`
}

ProfileData has data of a single profile.

type ProfileResponse

type ProfileResponse struct {
	Profile     ProfileData   `json:"profile"`
	NumProfiles int32         `json:"numProfiles"`
	Deployments []interface{} `json:"deployments"`
}

ProfileResponse contains the response produced when querying profile server.

func (*ProfileResponse) HasFunction

func (pr *ProfileResponse) HasFunction(functionName string) error

HasFunction returns nil if the function is present, or, if the function is not present, and error providing more details why the function is not present.

type TestRunner

type TestRunner struct {
	Client *http.Client
}

TestRunner has common elements used for testing profiling agents on a range of environments.

func (*TestRunner) QueryProfiles

func (tr *TestRunner) QueryProfiles(projectID, service, startTime, endTime, profileType string) (ProfileResponse, error)

QueryProfiles retrieves profiles of a specific type, from a specific time range, associated with a particular service and project.

Jump to

Keyboard shortcuts

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