testsuite

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2020 License: BSD-2-Clause Imports: 6 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Test = Params{
		Procs:      []int{1, 2, 3, 4, 8, 16, 32, 64},
		Bounds:     []int{1, 2, 3, 4, 5, 6, 7, 8},
		WorkStart:  []int{0},
		WorkDo:     []int{0},
		WorkFinish: []int{0},
	}

	Bench = Params{
		Procs:      []int{1, 4, 32, 256},
		Bounds:     []int{4, 8, 16, 64},
		WorkStart:  []int{0},
		WorkDo:     []int{0},
		WorkFinish: []int{0, 100},
	}
)

Functions

func RunBenchmarks

func RunBenchmarks(b *testing.B, setup *Setup)

func RunTests

func RunTests(t *testing.T, setup *Setup)

func StartClose

func StartClose(c Combiner) func()

Types

type AsyncCombiner

type AsyncCombiner interface {
	Combiner
	DoAsync(op interface{})
}

type Batcher

type Batcher interface {
	Start()
	Do(op interface{})
	Finish()
}

type Combiner

type Combiner interface {
	Do(op interface{})
}

type Desc

type Desc struct {
	Name    string
	Bounded bool
	Create  func(exe Batcher, bound int) Combiner
}

type Descs

type Descs []Desc

type Params

type Params struct {
	Procs      []int
	Bounds     []int
	WorkStart  []int
	WorkDo     []int
	WorkFinish []int
}

func (*Params) Iterate

func (params *Params) Iterate(descs Descs, fn func(*Setup))

type Runner

type Runner interface {
	Combiner
	Run()
	Close()
}

type Setup

type Setup struct {
	Name       string
	Create     func(exe Batcher, bound int) Combiner
	Bounds     int
	Procs      int
	WorkStart  int
	WorkDo     int
	WorkFinish int
}

func (*Setup) Bench

func (setup *Setup) Bench(b *testing.B, name string, bench func(b *testing.B, setup *Setup))

func (*Setup) FullName

func (setup *Setup) FullName(test string) string

func (*Setup) Make

func (setup *Setup) Make() (*Worker, Combiner)

func (*Setup) Test

func (setup *Setup) Test(t *testing.T, name string, test func(t *testing.T, setup *Setup))

type Worker

type Worker struct {
	WorkStart  int
	WorkDo     int
	WorkFinish int

	SleepStart  time.Duration
	SleepDo     time.Duration
	SleepFinish time.Duration

	Total   int64
	Batches int64
}

func NewWorker

func NewWorker() *Worker

func (*Worker) Do

func (exe *Worker) Do(v interface{})

func (*Worker) Finish

func (exe *Worker) Finish()

func (*Worker) Start

func (exe *Worker) Start()

Jump to

Keyboard shortcuts

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