Documentation ¶
Index ¶
- Constants
- func Ftoas(nums ...float64) []string
- func Itoas(nums ...int) []string
- func LogEVar(vars map[string]interface{})
- func LogLabels(labels ...string)
- func LogResult(latencies []int, variables ...string)
- func LogTitle(title string)
- type DockerHelper
- func (d *DockerHelper) CreateAliveContainers(num int) []string
- func (d *DockerHelper) CreateContainers(num int) []string
- func (d *DockerHelper) CreateDeadContainers(num int) []string
- func (d *DockerHelper) DoInspectContainerBenchmark(interval, testPeriod time.Duration, containerIDs []string) []int
- func (d *DockerHelper) DoListContainerBenchmark(interval, testPeriod time.Duration, listAll bool) []int
- func (d *DockerHelper) DoParallelContainerStartBenchmark(qps float64, testPeriod time.Duration, routineNumber int) []int
- func (d *DockerHelper) DoParallelContainerStopBenchmark(qps float64, routineNumber int) []int
- func (d *DockerHelper) DoParallelInspectContainerBenchmark(interval, testPeriod time.Duration, routineNumber int, containerIDs []string) []int
- func (d *DockerHelper) DoParallelListContainerBenchmark(interval, testPeriod time.Duration, routineNumber int, all bool) []int
- func (d *DockerHelper) GetContainerIDs() []string
- func (d *DockerHelper) GetContainerNum(all bool) int
- func (d *DockerHelper) LogError()
- func (d *DockerHelper) PullTestImage()
- func (d *DockerHelper) RemoveContainers(ids []string)
- func (d *DockerHelper) StartContainers(ids []string)
- func (d *DockerHelper) StopContainers(ids []string)
- type ErrorStats
Constants ¶
const ( // TestImage is the image used in the test TestImage = "ubuntu:latest" // TestCommand is the command run in the container TestCommand = "/bin/bash" )
Variables ¶
This section is empty.
Functions ¶
func LogEVar ¶
func LogEVar(vars map[string]interface{})
LogEVar prints all the environemnt variables
Types ¶
type DockerHelper ¶
type DockerHelper struct {
// contains filtered or unexported fields
}
DockerHelper provides the helper functions to simplify docker benchmark.
func NewDockerHelper ¶
func NewDockerHelper(client *docker.Client) *DockerHelper
NewDockerHelper creates and returns a new DockerHelper
func (*DockerHelper) CreateAliveContainers ¶
func (d *DockerHelper) CreateAliveContainers(num int) []string
CreateAliveContainers creates num of containers and also starts them, returns a slice of container ids
func (*DockerHelper) CreateContainers ¶
func (d *DockerHelper) CreateContainers(num int) []string
CreateContainers creates num of containers, returns a slice of container ids
func (*DockerHelper) CreateDeadContainers ¶
func (d *DockerHelper) CreateDeadContainers(num int) []string
CreateDeadContainers creates num of containers but not starts them, returns a slice of container ids
func (*DockerHelper) DoInspectContainerBenchmark ¶
func (d *DockerHelper) DoInspectContainerBenchmark(interval, testPeriod time.Duration, containerIDs []string) []int
DoInspectContainerBenchmark does periodically InspectContainer with specific interval, returns latencies of all the calls in nanoseconds
func (*DockerHelper) DoListContainerBenchmark ¶
func (d *DockerHelper) DoListContainerBenchmark(interval, testPeriod time.Duration, listAll bool) []int
DoListContainerBenchmark does periodically ListContainers with specific interval, returns latencies of all the calls in nanoseconds
func (*DockerHelper) DoParallelContainerStartBenchmark ¶
func (d *DockerHelper) DoParallelContainerStartBenchmark(qps float64, testPeriod time.Duration, routineNumber int) []int
DoParallelContainerStartBenchmark starts routineNumber of goroutines and let them start containers, returns latencies of all the starting calls in nanoseconds. There is a global rate limit on starting calls per second.
func (*DockerHelper) DoParallelContainerStopBenchmark ¶
func (d *DockerHelper) DoParallelContainerStopBenchmark(qps float64, routineNumber int) []int
DoParallelContainerStopBenchmark starts routineNumber of goroutines and let them stop containers, returns latencies of all the stopping calls in nanoseconds. There is a global rate limit on stopping calls per second.
func (*DockerHelper) DoParallelInspectContainerBenchmark ¶
func (d *DockerHelper) DoParallelInspectContainerBenchmark(interval, testPeriod time.Duration, routineNumber int, containerIDs []string) []int
DoParallelInspectContainerBenchmark starts routineNumber of goroutines and let them do DoInspectContainerBenchmark, returns latencies of all the calls in nanoseconds
func (*DockerHelper) DoParallelListContainerBenchmark ¶
func (d *DockerHelper) DoParallelListContainerBenchmark(interval, testPeriod time.Duration, routineNumber int, all bool) []int
DoParallelListContainerBenchmark starts routineNumber of goroutines and let them do DoListContainerBenchmark, returns latencies of all the calls in nanoseconds
func (*DockerHelper) GetContainerIDs ¶
func (d *DockerHelper) GetContainerIDs() []string
GetContainerIDs returns all the container ids in the system, panics when error occurs
func (*DockerHelper) GetContainerNum ¶
func (d *DockerHelper) GetContainerNum(all bool) int
GetContainerNum returns container number in the system, panics when error occurs
func (*DockerHelper) LogError ¶
func (d *DockerHelper) LogError()
LogError logs all the docker operation errors to stderr and clear current errors TODO(random-liu): Print configuration and errors to stdout, and benchmark result to files
func (*DockerHelper) PullTestImage ¶
func (d *DockerHelper) PullTestImage()
PullTestImage pulls the test image, panics when error occurs during pulling
func (*DockerHelper) RemoveContainers ¶
func (d *DockerHelper) RemoveContainers(ids []string)
RemoveContainers removes all the containers in ids slice
func (*DockerHelper) StartContainers ¶
func (d *DockerHelper) StartContainers(ids []string)
StartContainers starts all the containers in ids slice
func (*DockerHelper) StopContainers ¶
func (d *DockerHelper) StopContainers(ids []string)
StopContainers stops all the containers in ids slice
type ErrorStats ¶
ErrorStats analyzes the errors occurred during the benchmark