- 0.117.0 (latest)
- 0.116.0
- 0.115.1
- 0.114.0
- 0.113.0
- 0.112.2
- 0.111.0
- 0.110.10
- 0.109.0
- 0.108.0
- 0.107.0
- 0.106.0
- 0.105.0
- 0.104.0
- 0.103.0
- 0.102.1
- 0.101.1
- 0.100.2
- 0.99.0
- 0.98.0
- 0.97.0
- 0.96.0
- 0.95.0
- 0.94.1
- 0.93.3
- 0.92.3
- 0.91.1
- 0.90.0
- 0.89.0
- 0.88.0
- 0.87.0
- 0.86.0
- 0.85.0
- 0.84.0
- 0.83.0
- 0.82.0
- 0.81.0
- 0.80.0
- 0.79.0
- 0.78.0
- 0.77.0
- 0.76.0
- 0.75.0
Variables
BaseStartupTmpl
var BaseStartupTmpl = template.Must(template.New("startupScript").Parse("" /* 641 byte string literal not displayed */,
))
BaseStartupTmpl is the common part of the startup script that can be shared by multiple tests.
Functions
func CheckSerialOutputForBackoffs
func CheckSerialOutputForBackoffs(output string, numBenchmarks int, serverBackoffSubstring, createProfileSubstring, benchmarkNumPrefix string) error
CheckSerialOutputForBackoffs parses serial port output, and validates that server-specified backoffs were respected by the agent.
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.
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) PollAndLogSerialPort
func (tr *GCETestRunner) PollAndLogSerialPort(ctx context.Context, inst *InstanceConfig, finishString, errorString string, logf func(string, ...interface{})) (string, error)
PollAndLogSerialPort polls serial port 2 of the given GCE instance and returns when the finishString appears in the serial output of the instance, or when the context times out. It logs the serial output of the instance using the specified log function and returns the serial output in the first return value.
func (*GCETestRunner) StartInstance
func (tr *GCETestRunner) StartInstance(ctx context.Context, inst *InstanceConfig) error
StartInstance starts a GCE Instance with configs specified by inst, and which runs the startup script specified in inst. If image project is not specified, it defaults to "debian-cloud". If image family is not specified, it defaults to "debian-9".
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.
InstanceConfig
type InstanceConfig struct {
ProjectID string
Zone string
Name string
StartupScript string
MachineType string
ImageProject string
ImageFamily string
Scopes []string
}
InstanceConfig is configuration for starting single GCE instance for profiling agent test case.
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 sourceFileArray `json:"sourceFiles"`
}
ProfileData has data of a single profile.
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) CheckNonEmpty
func (pr *ProfileResponse) CheckNonEmpty() error
CheckNonEmpty returns nil if the profile has a profiles and deployments associated. Otherwise, returns a desciptive error.
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.
func (*ProfileResponse) HasFunctionInFile
func (pr *ProfileResponse) HasFunctionInFile(functionName string, filename string) error
HasFunctionInFile returns nil if function is present in the specified file, and an error if the function/file combination is not present in the profile.
func (*ProfileResponse) HasSourceFile
func (pr *ProfileResponse) HasSourceFile(filename string) error
HasSourceFile returns nil if the file (or file where the end of the file path matches the filename) is present in the profile. Or, if the filename is not present, an error is returned.
TestRunner
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.
func (*TestRunner) QueryProfilesWithZone
func (tr *TestRunner) QueryProfilesWithZone(projectID, service, startTime, endTime, profileType, zone string) (ProfileResponse, error)
QueryProfilesWithZone retrieves profiles of a specific type, from a specific time range, in a specified zone, associated with a particular service and project.