experiment

package
v0.0.0-...-a521f20 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2017 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// MaximumExperimentCall is the max number of times a experiment
	// can be called. This exists to prevent infinite loops on cyclic
	// dependencies
	MaximumExperimentCall = 100
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Cmd

type Cmd struct {
	Cmd       string
	ParsedCmd string
	Collect   []*string
	Moment    string
}

Cmd is a phase command

type Collect

type Collect struct {
	Collect    string
	File       string
	ParsedFile string
	Param      string
}

Collect represents methods of collecting metrics along experiment.

type Data

type Data struct {
	Columns []string
	Values  [][]interface{}
}

Data stores values to be used as parameters during tests execution. It stores values in a matrix with defined number of rows and columns.

type Executor

type Executor struct {
	Dir     string
	Verbose bool
	Output  string

	Experiments map[string]*Experiment

	Context context.Context

	Stdin  io.Reader
	Stdout io.Writer
	Stderr io.Writer
	// contains filtered or unexported fields
}

Executor executes a Expfile.

func (*Executor) FillNames

func (e *Executor) FillNames()

FillNames fill some objects with their names for better logging.

func (*Executor) ParseExpFile

func (e *Executor) ParseExpFile() error

ParseExpFile loads the experiment file defining various experiments.

func (*Executor) PrintExperimentsHelp

func (e *Executor) PrintExperimentsHelp()

PrintExperimentsHelp prints help os experiments that have a description

func (*Executor) Run

func (e *Executor) Run(exp string) error

Run runs Experiment

func (*Executor) RunExperiment

func (e *Executor) RunExperiment(ctx context.Context, expName string) error

RunExperiment runs a experiment by its name

type Experiment

type Experiment struct {
	Experiment string
	Desc       string
	Data       Data
	Collect    map[string]*Collect
	Phases     []*Phase
	Result     []map[string]interface{}
	Iteration  int
	Vars       map[string]interface{}
}

Experiment stores various values to configure an experiment where commands are called, and metrics are collected through various phases of execution.

type Phase

type Phase struct {
	Phase string
	Desc  string
	Cmds  []*Cmd
}

Phase represents stages for the experiment executed.

Jump to

Keyboard shortcuts

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