cmd

package
v0.0.0-...-73c8340 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BenchmarkCmd = &cobra.Command{
	Use:   "benchmark",
	Short: "Run exec time benchmarks",
	Run: func(cmd *cobra.Command, args []string) {
		benchmarkCmd(cmd)
	},
}

BenchmarkCmd executes the script execution benchmark.

View Source
var CompareCmd = &cobra.Command{
	Use:   "compare",
	Short: "Compare the results of two benchmark runs",
	Run: func(cmd *cobra.Command, args []string) {
		compareCmd(cmd)
	},
}

CompareCmd compares two benchmark results produced by the BenchmarkCmd.

View Source
var RootCmd = &cobra.Command{
	Use:   "exectime_benchmark",
	Short: "Run and compare exectime benchmarks",
}

RootCmd executes the subcommands.

Functions

func UTest

func UTest(a, b []float64) (float64, error)

UTest performs a normal approximation to a Mann-Whitney U-Test on the given data. This approximation is reasonable when the sample sizes are >= 20.

Types

type BytesDistribution

type BytesDistribution struct {
	Bytes []int
}

BytesDistribution contains Bytess and implements the Distribution interface.

func (*BytesDistribution) Append

func (d *BytesDistribution) Append(v interface{})

Append a value to the bytes distribution.

func (*BytesDistribution) Diff

Diff computes the difference between this distribution and another bytes distribution.

func (*BytesDistribution) Mean

func (d *BytesDistribution) Mean() float64

Mean caluates the mean of the time distribution.

func (*BytesDistribution) Stddev

func (d *BytesDistribution) Stddev() float64

Stddev calculates the stddev of the time distribution.

func (*BytesDistribution) Summarize

func (d *BytesDistribution) Summarize() string

Summarize returns the Mean +/- stddev.

func (*BytesDistribution) Type

func (d *BytesDistribution) Type() string

Type returns the type of distribution this is, for json marshalling purposes.

type Distribution

type Distribution interface {
	Summarize() string
	Type() string
	Append(interface{})
	Diff(Distribution) (DistributionDiff, error)
}

Distribution is the interface used to make the stats.

type DistributionDiff

type DistributionDiff interface {
	Summarize() string
}

DistributionDiff represents the difference between two distributions.

type ErrorDistribution

type ErrorDistribution struct {
	Errors []error
}

ErrorDistribution contains Errors.

func (*ErrorDistribution) Append

func (d *ErrorDistribution) Append(v interface{})

Append a value to the error distribution.

func (*ErrorDistribution) Diff

Diff computes the difference between this distribution and another error distribution.

func (*ErrorDistribution) Num

func (d *ErrorDistribution) Num() int

Num counts the number of errors.

func (*ErrorDistribution) Summarize

func (d *ErrorDistribution) Summarize() string

Summarize returns the number of errors.

func (*ErrorDistribution) Type

func (d *ErrorDistribution) Type() string

Type returns the type of distribution this is, for json marshalling purposes.

type ScriptExecData

type ScriptExecData struct {
	// The Name of the script we're running.
	Name string
	// The Distributions of Statistics to record.
	Distributions distributionMap
}

ScriptExecData contains the data for a single executed script.

type TimeDistribution

type TimeDistribution struct {
	Times []time.Duration
}

TimeDistribution contains Times and implements the Distribution interface.

func (*TimeDistribution) Append

func (t *TimeDistribution) Append(v interface{})

Append a value to the time distribution.

func (*TimeDistribution) Diff

Diff computes the difference between this distribution and another time distribution.

func (*TimeDistribution) Mean

func (t *TimeDistribution) Mean() time.Duration

Mean caluates the mean of the time distribution.

func (*TimeDistribution) Stddev

func (t *TimeDistribution) Stddev() time.Duration

Stddev calculates the stddev of the time distribution.

func (*TimeDistribution) Summarize

func (t *TimeDistribution) Summarize() string

Summarize returns the Mean +/- stddev.

func (*TimeDistribution) Type

func (t *TimeDistribution) Type() string

Type returns the type of distribution this is, for json marshalling purposes.

Jump to

Keyboard shortcuts

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