benchmark

package
v1.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Overview

Package benchmark runs benchmark tests of Finch.

Package benchmark runs benchmark tests of Finch.

Index

Constants

View Source
const InstalledTestSubject = "finch"

InstalledTestSubject is the test subject when Finch is installed.

Variables

View Source
var Installed = flag.Bool("installed", false, "the flag to show whether the tests are run against installed application")

Installed indicates whether the tests are run against installed application.

Functions

func GetSubject

func GetSubject() (string, error)

GetSubject returns the testing subject based on INSTALLED flag.

func Wrapper added in v0.6.1

func Wrapper(b *testing.B, targetFunc func(), cleanupFunc func())

Wrapper reports the benchmarking metrics of targetFunc to testing.B.

Types

type Metrics added in v0.6.1

type Metrics struct {
	PeakCPUUsage    float64
	AverageCPUUsage float64
	TotalCPUTime    time.Duration
	DiskUsageDelta  int64
}

Metrics includes all the additional metrics that Finch benchmark reports, except testing.B natively supported metrics like execution time and memory.

func (*Metrics) Add added in v0.6.1

func (m *Metrics) Add(other Metrics)

Add combines the values of the current Metrics instance with the values of another Metrics instance passed as an argument. It updates the current instance's fields by adding the corresponding values from the other instance.

type Suite added in v0.6.1

type Suite struct {
	// contains filtered or unexported fields
}

Suite is a struct that groups benchmark functions and shared state.

func (*Suite) BenchmarkContainerRun added in v0.6.1

func (suite *Suite) BenchmarkContainerRun(b *testing.B)

BenchmarkContainerRun measures the metrics to run a container.

func (*Suite) BenchmarkImageBuild added in v0.6.1

func (suite *Suite) BenchmarkImageBuild(b *testing.B)

BenchmarkImageBuild measures the metrics to build an image.

func (*Suite) BenchmarkVMInit added in v0.6.1

func (suite *Suite) BenchmarkVMInit(b *testing.B)

BenchmarkVMInit measures the metrics to initialize the VM.

func (*Suite) BenchmarkVMStart added in v0.6.1

func (suite *Suite) BenchmarkVMStart(b *testing.B)

BenchmarkVMStart measures the metrics to start the VM.

func (*Suite) InitVM added in v0.6.1

func (suite *Suite) InitVM() error

InitVM initializes a virtual machine.

func (*Suite) RemoveVM added in v0.6.1

func (suite *Suite) RemoveVM() error

RemoveVM removes the VM.

func (*Suite) Setup added in v0.6.1

func (suite *Suite) Setup() error

Setup initializes the Suite by getting the subject.

func (*Suite) StartVM added in v0.6.1

func (suite *Suite) StartVM() error

StartVM starts the VM.

func (*Suite) StopVM added in v0.6.1

func (suite *Suite) StopVM() error

StopVM stops the VM.

Jump to

Keyboard shortcuts

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