Documentation ¶
Overview ¶
Package harness holds utility code for running benchmarks on Docker.
Index ¶
- func DebugLog(b *testing.B, msg string, args ...interface{})
- func DropCaches(machine Machine) error
- func Init() error
- func MakeMount(machine Machine, fsType FileSystemType, cu *cleanup.Cleanup) ([]mount.Mount, string, error)
- func SetFixedBenchmarks()
- func WaitUntilServing(ctx context.Context, machine Machine, server net.IP, port int) error
- type FileSystemType
- type Machine
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DropCaches ¶
DropCaches drops caches on the provided machine. Requires root.
func MakeMount ¶
func MakeMount(machine Machine, fsType FileSystemType, cu *cleanup.Cleanup) ([]mount.Mount, string, error)
MakeMount makes a mount and cleanup based on the requested type. Bind and volume mounts are backed by a temp directory made with mktemp. tmpfs mounts require no such backing and are just made. rootfs mounts do not make a mount, but instead return a target direectory at root. It is up to the caller to call Clean on the passed *cleanup.Cleanup
func SetFixedBenchmarks ¶
func SetFixedBenchmarks()
SetFixedBenchmarks causes all benchmarks to run once.
This must be set if they cannot scale with N. Note that this uses 1ns instead of 1x due to https://github.com/golang/go/issues/32051.
Types ¶
type FileSystemType ¶
type FileSystemType string
FileSystemType represents a type container mount.
const ( // BindFS indicates a bind mount should be created. BindFS FileSystemType = "bindfs" // TmpFS indicates a tmpfs mount should be created. TmpFS FileSystemType = "tmpfs" // RootFS indicates no mount should be created and the root mount should be used. RootFS FileSystemType = "rootfs" )
type Machine ¶
type Machine interface { // GetContainer gets a container from the machine. The container uses the // runtime under test and is profiled if requested by flags. GetContainer(ctx context.Context, log testutil.Logger) *dockerutil.Container // GetNativeContainer gets a native container from the machine. Native containers // use runc by default and are not profiled. GetNativeContainer(ctx context.Context, log testutil.Logger) *dockerutil.Container // RunCommand runs cmd on this machine. RunCommand(cmd string, args ...string) (string, error) // Returns IP Address for the machine. IPAddress() (net.IP, error) // CleanUp cleans up this machine. CleanUp() }
Machine describes a real machine for use in benchmarks.
func GetMachine ¶
GetMachine returns this run's implementation of machine.