benchmark

package
v1.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func TestPerformance

func TestPerformance(t *testing.T)

TestPerformance checks configuration parameters (specified through flags) and then runs benchmark tests using the Ginkgo runner. If a "report directory" is specified, one or more JUnit test reports will be generated in this directory.

Types

type LifecycleBenchmarkDatapoint added in v1.24.2

type LifecycleBenchmarkDatapoint struct {
	// int64 index of the sample.
	SampleIndex int `json:"sampleIndex"`

	// int64 nanosecond timestamp of the start of the result.
	StartTime int64 `json:"startTime"`

	// int64 nanosecond timestamp of the start of the result.
	EndTime int64 `json:"endTime"`

	// Slice of int64s representing the durations of individual operations.
	// The operation durations should be in the order they were executed in.
	// Note that the sum of OperationsDurationsNs need not be exactly equal to the duration
	// determined by subtracting StartTime from EndTime, as there may be additional steps
	// (e.g. timer setup) performed between the invidual operations.
	OperationsDurationsNs []int64 `json:"operationsDurationsNs"`

	// String mapping for adding arbitrary meta-info for the lifecycle result:
	MetaInfo map[string]string `json:"metaInfo"`
}

LifecycleBenchmarkDatapoint encodes a single benchmark for a lifecycle operation. Contains a slice of int64s which represent the duration in nanoseconds of the operations which comprise a lifecycle being benchmarked. (e.g. the individual CRUD operations which are cycled through during the benchmark)

type LifecycleBenchmarksResultsManager added in v1.24.2

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

Type which tracks lifecycle benchmark results through channels.

func NewLifecycleBenchmarksResultsManager added in v1.24.2

func NewLifecycleBenchmarksResultsManager(initialResultsSet LifecycleBenchmarksResultsSet, resultsChannelTimeoutSeconds int) *LifecycleBenchmarksResultsManager

Instantiates a new LifecycleBenchmarksResultsManager and its internal channels/structures.

func (*LifecycleBenchmarksResultsManager) AwaitAllResults added in v1.24.2

func (lbrm *LifecycleBenchmarksResultsManager) AwaitAllResults(timeoutSeconds int) error

Waits for the result consumer goroutine and returns all the results registered insofar.

func (*LifecycleBenchmarksResultsManager) StartResultsConsumer added in v1.24.2

func (lbrm *LifecycleBenchmarksResultsManager) StartResultsConsumer() chan *LifecycleBenchmarkDatapoint

Starts the results consumer goroutine and returns the channel to write results to. A nil value must be sent after all other results were sent to indicate the end of the result stream.

func (*LifecycleBenchmarksResultsManager) WriteResultsFile added in v1.24.2

func (lbrm *LifecycleBenchmarksResultsManager) WriteResultsFile(filepath string) error

Saves the results gathered so far as JSON under the given filepath.

type LifecycleBenchmarksResultsSet added in v1.24.2

type LifecycleBenchmarksResultsSet struct {
	// Slice of string operation names which represent one cycle.
	OperationsNames []string `json:"operationsNames"`

	// The maximum number of lifecycles which were benchmarked in parallel.
	// Anything <= 1 should be considered sequential.
	NumParallel int `json:"numParallel"`

	// List of datapoints for each lifecycle benchmark.
	Datapoints []LifecycleBenchmarkDatapoint `json:"datapoints"`
}

LifecycleBenchmarkResultsSet houses results for benchmarks involving resource lifecycles which include multiple benchmarked iterations of the cycle.

Jump to

Keyboard shortcuts

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