change

package
v0.0.0-...-c9cfaf6 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2020 License: BSD-3-Clause Imports: 5 Imported by: 1

Documentation

Overview

Package change implements change detection in benchmark timeseries.

Index

Constants

This section is empty.

Variables

View Source
var DefaultDetector = &Detector{
	WindowSize:    20,
	MinEffectSize: 3,

	M:                15,
	K:                3,
	PercentThreshold: 4,
	Context:          2,
}

DefaultDetector has sensible default parameter choices.

Functions

This section is empty.

Types

type Change

type Change struct {
	CommitIndex int
	EffectSize  float64
	Pre         Stats
	Post        Stats
}

func (*Change) Delta

func (c *Change) Delta() float64

func (*Change) Percent

func (c *Change) Percent() float64

type Detector

type Detector struct {
	// Adaptive Kolmogorov-Zurbenko pass.
	M, K             int     // KZA parameters
	PercentThreshold float64 // threshold for KZA pass
	Context          int     // number of points to consider either side

	// Distribution comparison.
	WindowSize    int     // window to consider either side
	MinEffectSize float64 // Cohen's d threshold
}

Detector is a change detector.

Uses a hybrid approach. A first pass Adaptive Kolmogorov-Zurbenko (KZA) filter is applied to identify structural breaks in the timeseries. This is effective at identifiying regions of interest, but imprecise at pinpointing the exact change point. For each candidates from the KZA pass, we inspect a few points around the candidate and compare distributions of a windows either size. The point with the largest effect size (Cohen's d) is taken as the change point.

func (*Detector) Detect

func (d *Detector) Detect(series trace.Series) []Change

Detect changes in series.

type Stats

type Stats struct {
	N        int
	Mean     float64
	Variance float64
}

func (Stats) Stddev

func (s Stats) Stddev() float64

type Type

type Type int

Type of a change: improvement or regression.

const (
	TypeUnknown Type = iota
	TypeUnchanged
	TypeImprovement
	TypeRegression
)

Supported change types.

func Classify

func Classify(pre, post float64, unit string) Type

Classify a change from pre to post in the given unit.

func TypeString

func TypeString(s string) (Type, error)

TypeString retrieves an enum value from the enum constants string name. Throws an error if the param is not part of the enum.

func TypeValues

func TypeValues() []Type

TypeValues returns all values of the enum

func (Type) IsAType

func (i Type) IsAType() bool

IsAType returns "true" if the value is listed in the enum definition. "false" otherwise

func (Type) String

func (i Type) String() string

Directories

Path Synopsis
Package changetest provides utilities for change detection testing.
Package changetest provides utilities for change detection testing.

Jump to

Keyboard shortcuts

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